Fix comment autoinsert for c-family as well.

Fixes #1074
This commit is contained in:
Maxime Coste 2017-01-02 12:05:49 +00:00
parent fc4dc93209
commit c3e1bab9d6
5 changed files with 8 additions and 1 deletions

View File

@ -72,7 +72,7 @@ def -hidden c-family-insert-on-newline %[ eval -draft %[
exec -save-regs '' k <a-x>1s^\h*(//+\h*)<ret> y
try %[
# if the previous comment isn't empty, create a new one
exec <a-x><a-K>^\h*//+\h*$<ret> j<a-x>s^\h*<ret>p
exec <a-x><a-K>^\h*//+\h*$<ret> j<a-x>s^\h*<ret>P
] catch %[
# if there is no text in the previous comment, remove it completely
exec d

View File

@ -0,0 +1 @@
i<ret><esc>

View File

@ -0,0 +1 @@
// abc%( )def

View File

@ -0,0 +1,2 @@
// abc
// def

View File

@ -0,0 +1,3 @@
source "%val{runtime}/colors/default.kak"
source "%val{runtime}/rc/core/c-family.kak"
set buffer filetype cpp