mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-25 12:36:11 +03:00
Better comment inserting tests and fix implementation
This commit is contained in:
parent
fcc04384d1
commit
0b1654b0cf
@ -173,7 +173,7 @@ define-command -hidden ruby-indent-on-new-line %{
|
||||
define-command -hidden ruby-insert-on-new-line %[
|
||||
evaluate-commands -no-hooks -draft -itersel %[
|
||||
# copy _#_ comment prefix and following white spaces
|
||||
try %{ exec -draft k <a-x> s ^\h*#\h* <ret> y jgh P }
|
||||
try %{ exec -draft k <a-x> s ^\h*\K#\h* <ret> y jgi P }
|
||||
# wisely add end structure
|
||||
evaluate-commands -save-regs x %[
|
||||
try %{ execute-keys -draft k <a-x> s ^ \h + <ret> \" x y } catch %{ reg x '' }
|
||||
|
@ -1 +1 @@
|
||||
c<ret>
|
||||
c<ret><esc><a-o>jo# comment3<ret>comment4<esc><a-o>jo# indented<ret>indented2
|
||||
|
@ -1,2 +1,8 @@
|
||||
# Comment
|
||||
# comment2
|
||||
|
||||
# comment3
|
||||
# comment4
|
||||
|
||||
# indented
|
||||
# indented2
|
||||
|
Loading…
Reference in New Issue
Block a user