diff --git a/rc/filetype/c-family.kak b/rc/filetype/c-family.kak index 57ee4a1c3..c79f933e5 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^[^*]*(\*)& ]