diff --git a/rc/filetype/elixir.kak b/rc/filetype/elixir.kak index 2485d733..692de2d2 100644 --- a/rc/filetype/elixir.kak +++ b/rc/filetype/elixir.kak @@ -95,7 +95,7 @@ define-command -hidden elixir-trim-indent %{ define-command -hidden elixir-insert-on-new-line %[ evaluate-commands -no-hooks -draft -itersel %[ # copy '#' comment prefix and following white spaces - try %{ exec -draft k s ^\h*#\h* y jgh P } + try %{ exec -draft k s ^\h*\K#\h* y jgi P } # wisely add end structure evaluate-commands -save-regs x %[ try %{ execute-keys -draft k s ^ \h + \" x y } catch %{ reg x '' } diff --git a/test/indent/elixir/insert-comment-hash/cmd b/test/indent/elixir/insert-comment-hash/cmd index e3036a40..bd828f35 100644 --- a/test/indent/elixir/insert-comment-hash/cmd +++ b/test/indent/elixir/insert-comment-hash/cmd @@ -1 +1 @@ -c +cjo# comment3comment4jo# indentedindented2 diff --git a/test/indent/elixir/insert-comment-hash/out b/test/indent/elixir/insert-comment-hash/out index bde83b7a..1dba5ac9 100644 --- a/test/indent/elixir/insert-comment-hash/out +++ b/test/indent/elixir/insert-comment-hash/out @@ -1,2 +1,8 @@ # Comment # comment2 + +# comment3 +# comment4 + +# indented +# indented2