diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index 78949de5..97f5ab58 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -72,7 +72,7 @@ def -hidden c-family-insert-on-newline %[ eval -draft %[ exec -save-regs '' k 1s^\h*(//+\h*) y try %[ # if the previous comment isn't empty, create a new one - exec ^\h*//+\h*$ js^\h*p + exec ^\h*//+\h*$ js^\h*P ] catch %[ # if there is no text in the previous comment, remove it completely exec d diff --git a/test/regression/1074-comment-leader-autoinsert-error/cmd b/test/regression/1074-comment-leader-autoinsert-error/cmd new file mode 100644 index 00000000..54aed4f8 --- /dev/null +++ b/test/regression/1074-comment-leader-autoinsert-error/cmd @@ -0,0 +1 @@ +i diff --git a/test/regression/1074-comment-leader-autoinsert-error/in b/test/regression/1074-comment-leader-autoinsert-error/in new file mode 100644 index 00000000..aa8c0d6c --- /dev/null +++ b/test/regression/1074-comment-leader-autoinsert-error/in @@ -0,0 +1 @@ +// abc%( )def diff --git a/test/regression/1074-comment-leader-autoinsert-error/out b/test/regression/1074-comment-leader-autoinsert-error/out new file mode 100644 index 00000000..10251d2e --- /dev/null +++ b/test/regression/1074-comment-leader-autoinsert-error/out @@ -0,0 +1,2 @@ +// abc +// def diff --git a/test/regression/1074-comment-leader-autoinsert-error/rc b/test/regression/1074-comment-leader-autoinsert-error/rc new file mode 100644 index 00000000..53c40654 --- /dev/null +++ b/test/regression/1074-comment-leader-autoinsert-error/rc @@ -0,0 +1,3 @@ +source "%val{runtime}/colors/default.kak" +source "%val{runtime}/rc/core/c-family.kak" +set buffer filetype cpp