tweak :comment-line behaviour to comment selected lines

This commit is contained in:
Alex Leferry 2 2017-01-15 14:43:45 +01:00
parent 4ad4b2d41a
commit 1f0ec535bd

View File

@ -123,7 +123,7 @@ def comment-selection -docstring "Comment/uncomment the current selection" %{
} }
} }
def comment-line -docstring "Comment/uncomment the current line" %{ def comment-line -docstring "(un)comment selected lines using line comments" %{
%sh{ %sh{
readonly opening="${kak_opt_comment_line_chars}" readonly opening="${kak_opt_comment_line_chars}"
readonly opening_escaped="\\Q${opening}\\E" readonly opening_escaped="\\Q${opening}\\E"
@ -134,8 +134,8 @@ def comment-line -docstring "Comment/uncomment the current line" %{
fi fi
printf %s\\n "eval -draft %{ printf %s\\n "eval -draft %{
## Select the content of the line, without indentation ## Select the content of the lines, without indentation
exec I<esc><a-l> exec <a-s>I<esc><a-l>
try %{ try %{
## There's no text on the line ## There's no text on the line