Fix python comment copy logic in python.kak

And introduce the first unit test that sources bundled support
scripts.

Fixes #860
This commit is contained in:
Maxime Coste 2016-10-13 20:10:41 +01:00
parent 6bfc68d4f3
commit 5af29b0254
6 changed files with 12 additions and 2 deletions

View File

@ -60,8 +60,8 @@ def -hidden _python_indent_on_new_line %{
# cleanup trailing whitespaces from previous line # cleanup trailing whitespaces from previous line
try %{ exec -draft k <a-x> s \h+$ <ret> d } try %{ exec -draft k <a-x> s \h+$ <ret> d }
# copy '#' comment prefix and following white spaces # copy '#' comment prefix and following white spaces
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p } try %{ exec -draft k x s ^\h*#\h* <ret> y jgh P }
# indent after : # indent after line ending with :
try %{ exec -draft <space> k x <a-k> :$ <ret> j <a-gt> } try %{ exec -draft <space> k x <a-k> :$ <ret> j <a-gt> }
} }
} }

1
share/kak/rc Symbolic link
View File

@ -0,0 +1 @@
../../rc

View File

@ -0,0 +1 @@
<a-j>welc<ret><esc>

View File

@ -0,0 +1,2 @@
# comment
if haha

View File

@ -0,0 +1,2 @@
# comment
# if haha

View File

@ -0,0 +1,4 @@
source "%val{runtime}/colors/default.kak"
source "%val{runtime}/rc/core/formatter.kak"
source "%val{runtime}/rc/core/python.kak"
set buffer filetype python