diff --git a/rc/core/python.kak b/rc/core/python.kak index d5079504..69da651a 100644 --- a/rc/core/python.kak +++ b/rc/core/python.kak @@ -60,8 +60,8 @@ def -hidden _python_indent_on_new_line %{ # cleanup trailing whitespaces from previous line try %{ exec -draft k s \h+$ d } # copy '#' comment prefix and following white spaces - try %{ exec -draft k x s ^\h*\K#\h* y j p } - # indent after : + try %{ exec -draft k x s ^\h*#\h* y jgh P } + # indent after line ending with : try %{ exec -draft k x :$ j } } } diff --git a/share/kak/rc b/share/kak/rc new file mode 120000 index 00000000..f8fbe638 --- /dev/null +++ b/share/kak/rc @@ -0,0 +1 @@ +../../rc \ No newline at end of file diff --git a/test/regression/860-python-incorrect-commenting/cmd b/test/regression/860-python-incorrect-commenting/cmd new file mode 100644 index 00000000..a5ac4138 --- /dev/null +++ b/test/regression/860-python-incorrect-commenting/cmd @@ -0,0 +1 @@ +welc diff --git a/test/regression/860-python-incorrect-commenting/in b/test/regression/860-python-incorrect-commenting/in new file mode 100644 index 00000000..be851b25 --- /dev/null +++ b/test/regression/860-python-incorrect-commenting/in @@ -0,0 +1,2 @@ +# comment +if haha diff --git a/test/regression/860-python-incorrect-commenting/out b/test/regression/860-python-incorrect-commenting/out new file mode 100644 index 00000000..91b4dc7c --- /dev/null +++ b/test/regression/860-python-incorrect-commenting/out @@ -0,0 +1,2 @@ +# comment +# if haha diff --git a/test/regression/860-python-incorrect-commenting/rc b/test/regression/860-python-incorrect-commenting/rc new file mode 100644 index 00000000..4eec08e1 --- /dev/null +++ b/test/regression/860-python-incorrect-commenting/rc @@ -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