Fix elixir copying comment # sign

Elixir uses # for comments, not --.
Implementation is copied from Nim.
This commit is contained in:
Dmitry Matveyev 2021-06-06 01:05:45 +06:00
parent 0f49e7375e
commit 8867e40929
5 changed files with 9 additions and 2 deletions

View File

@ -94,8 +94,8 @@ define-command -hidden elixir-trim-indent %{
define-command -hidden elixir-insert-on-new-line %[ define-command -hidden elixir-insert-on-new-line %[
evaluate-commands -no-hooks -draft -itersel %[ evaluate-commands -no-hooks -draft -itersel %[
# copy -- comments prefix and following white spaces # copy '#' comment prefix and following white spaces
try %{ execute-keys -draft k <a-x> s ^\h*\K--\h* <ret> y gh j P } try %{ exec -draft k <a-x> s ^\h*#\h* <ret> y jgh P }
# wisely add end structure # wisely add end structure
evaluate-commands -save-regs x %[ evaluate-commands -save-regs x %[
try %{ execute-keys -draft k <a-x> s ^ \h + <ret> \" x y } catch %{ reg x '' } try %{ execute-keys -draft k <a-x> s ^ \h + <ret> \" x y } catch %{ reg x '' }

View File

@ -0,0 +1 @@
c<ret>

View File

@ -0,0 +1 @@
# Comment %( )comment2

View File

@ -0,0 +1,2 @@
# Comment
# comment2

View File

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