From ed9d99c7b37423d49fe943df4d271761e4e74ba8 Mon Sep 17 00:00:00 2001 From: Cormac Stephenson Date: Mon, 29 Nov 2021 12:33:30 +0000 Subject: [PATCH] c-family: fix whitespace trimming in comments --- rc/filetype/c-family.kak | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rc/filetype/c-family.kak b/rc/filetype/c-family.kak index 57ee4a1c..c79f933e 100644 --- a/rc/filetype/c-family.kak +++ b/rc/filetype/c-family.kak @@ -151,6 +151,9 @@ define-command -hidden c-family-insert-on-newline %[ evaluate-commands -itersel execute-keys d ] ] + + # trim trailing whitespace on the previous line + try %[ execute-keys -draft k s\h+$ d ] ] try %[ # if the previous line isn't within a comment scope, break @@ -180,7 +183,7 @@ define-command -hidden c-family-insert-on-newline %[ evaluate-commands -itersel ] # trim trailing whitespace on the previous line - try %[ execute-keys -draft s\h+$ d ] + try %[ execute-keys -draft k s\h+$ d ] # align the new star with the previous one execute-keys K1s^[^*]*(\*)& ]