From 9298efd19bd024f96df3eab0cef92d03581969ba Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 5 May 2016 13:59:06 +0100 Subject: [PATCH] Restore whitespace cleanup on InsertEnd in python.kak --- rc/core/python.kak | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rc/core/python.kak b/rc/core/python.kak index 5fa07d0f..37d72e6e 100644 --- a/rc/core/python.kak +++ b/rc/core/python.kak @@ -57,7 +57,7 @@ def -hidden _python_indent_on_new_line %{ eval -draft -itersel %{ # preserve previous line indent try %{ exec -draft K } - # filter previous 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 } @@ -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 \; s ^\h+$ d } } set window formatcmd "autopep8 -" }