Skip to content

Commit d3e0782

Browse files
committed
Merge remote-tracking branch 'arrufat/go-new-line-comment'
2 parents dea8d1b + d93b23b commit d3e0782

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

rc/filetype/go.kak

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,15 @@ define-command -hidden go-indent-on-closing-curly-brace %[
135135
define-command -hidden go-insert-comment-on-new-line %[
136136
evaluate-commands -no-hooks -draft -itersel %[
137137
# copy // comments prefix and following white spaces
138-
try %{ execute-keys -draft <semicolon><c-s>kx s ^\h*\K/{2,}\h* <ret> y<c-o>P<esc> }
138+
try %{
139+
execute-keys -draft <semicolon><c-s>kx s ^\h*\K/{2,}\h* <ret> y<c-o>P<esc>
140+
# check for empty comments and delete them
141+
try %{
142+
execute-keys kx<a-K>^\h*//+\h*$<ret>
143+
} catch %{
144+
execute-keys Jx_d
145+
}
146+
}
139147
]
140148
]
141149

0 commit comments

Comments
 (0)