mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-24 07:53:41 +03:00
Restore whitespace cleanup on InsertEnd in python.kak
This commit is contained in:
parent
8c5d3128ef
commit
9298efd19b
@ -57,7 +57,7 @@ def -hidden _python_indent_on_new_line %{
|
||||
eval -draft -itersel %{
|
||||
# preserve previous line indent
|
||||
try %{ exec -draft <space> K <a-&> }
|
||||
# filter previous line
|
||||
# cleanup trailing whitespaces from previous line
|
||||
try %{ exec -draft k <a-x> s \h+$ <ret> d }
|
||||
# copy '#' comment prefix and following white spaces
|
||||
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
|
||||
@ -72,6 +72,8 @@ def -hidden _python_indent_on_new_line %{
|
||||
hook global WinSetOption filetype=python %{
|
||||
addhl ref python
|
||||
hook window InsertChar \n -group python-indent _python_indent_on_new_line
|
||||
# cleanup trailing whitespaces on current line insert end
|
||||
hook window InsertEnd .* -group python-indent %{ try %{ exec -draft \; <a-x> s ^\h+$ <ret> d } }
|
||||
|
||||
set window formatcmd "autopep8 -"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user