diff --git a/rc/filetype/d.kak b/rc/filetype/d.kak index 16062097..5f7e9799 100644 --- a/rc/filetype/d.kak +++ b/rc/filetype/d.kak @@ -115,8 +115,8 @@ define-command -hidden d-indent-on-new-line %~ try %{ execute-keys -draft k s \h+$ d } # align to opening paren of previous line try %{ execute-keys -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } - # copy // comments prefix - try %{ execute-keys -draft k s ^\h*\K/{2,} yP } + # copy // comments prefix and following white spaces + try %{ execute-keys -draft k s ^\h*\K/{2,}\h* yP } # indent after a switch's case/default statements try %[ execute-keys -draft k ^\h*(case|default).*:$ j ] # indent after if|else|while|for diff --git a/rc/filetype/dart.kak b/rc/filetype/dart.kak index 2a07eafc..fee017ac 100644 --- a/rc/filetype/dart.kak +++ b/rc/filetype/dart.kak @@ -91,8 +91,8 @@ define-command -hidden dart-indent-on-new-line %~ try %{ execute-keys -draft k s \h+$ d } # align to opening paren of previous line try %{ execute-keys -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } - # copy // comments prefix - try %{ execute-keys -draft k s ^\h*\K/{2,} yP } + # copy // comments prefix and following white spaces + try %{ execute-keys -draft k s ^\h*\K/{2,}\h* yP } # indent after a switch's case/default statements try %[ execute-keys -draft k ^\h*(case|default).*:$ j ] # indent after if|else|while|for diff --git a/rc/filetype/go.kak b/rc/filetype/go.kak index 4c9ad7ee..43c94832 100644 --- a/rc/filetype/go.kak +++ b/rc/filetype/go.kak @@ -107,8 +107,8 @@ define-command -hidden go-indent-on-new-line %~ try %{ execute-keys -draft k s \h+$ d } # align to opening paren of previous line try %{ execute-keys -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } - # copy // comments prefix - try %{ execute-keys -draft k s ^\h*\K/{2,} yP } + # copy // comments prefix and following white spaces + try %{ execute-keys -draft k s ^\h*\K/{2,}\h* yP } # indent after a switch's case/default statements try %[ execute-keys -draft k ^\h*(case|default).*:$ j ] # deindent closing brace(s) when after cursor diff --git a/rc/filetype/java.kak b/rc/filetype/java.kak index d5c3fd8b..a1047665 100644 --- a/rc/filetype/java.kak +++ b/rc/filetype/java.kak @@ -50,8 +50,8 @@ define-command -hidden java-indent-on-new-line %~ try %{ execute-keys -draft k s \h+$ d } # align to opening paren of previous line try %{ execute-keys -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } - # copy // comments prefix - try %{ execute-keys -draft k s ^\h*\K/{2,} yP } + # copy // comments prefix and following white spaces + try %{ execute-keys -draft k s ^\h*\K/{2,}\h* yP } # indent after a switch's case/default statements try %[ execute-keys -draft k ^\h*(case|default).*:$ j ] # indent after keywords diff --git a/rc/filetype/perl.kak b/rc/filetype/perl.kak index 26a5dbe4..1106b544 100644 --- a/rc/filetype/perl.kak +++ b/rc/filetype/perl.kak @@ -116,8 +116,8 @@ define-command -hidden perl-indent-on-new-line %~ try %{ execute-keys -draft k s \h+$ d } # align to opening paren of previous line try %{ execute-keys -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } - # copy # comments prefix - try %{ execute-keys -draft k s ^\h*\K# yP } + # copy # comments prefix and following white spaces + try %{ execute-keys -draft k s ^\h*\K#\h* yP } # indent after a switch's case/default statements try %[ execute-keys -draft k ^\h*(case|default).*:$ j ] # indent after if|else|while|for