From 21614cb06ea4f7a7349c628e5b8a754f730b2f0d Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Tue, 22 Oct 2019 11:02:06 +0200 Subject: src: Create a named key This commit allows using the expansion in commands, instead of `\;`. It makes commands look more elegant, and prevents new-comers from falling into the trap of using without escaping the semicolon. --- rc/filetype/python.kak | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'rc/filetype/python.kak') diff --git a/rc/filetype/python.kak b/rc/filetype/python.kak index b88f5343..93f9a618 100644 --- a/rc/filetype/python.kak +++ b/rc/filetype/python.kak @@ -18,7 +18,7 @@ hook global WinSetOption filetype=python %{ hook window InsertChar \n -group python-indent python-indent-on-new-line # cleanup trailing whitespaces on current line insert end - hook window ModeChange pop:insert:.* -group python-trim-indent %{ try %{ execute-keys -draft \; s ^\h+$ d } } + hook window ModeChange pop:insert:.* -group python-trim-indent %{ try %{ execute-keys -draft s ^\h+$ d } } hook -once -always window WinSetOption filetype=.* %{ remove-hooks window python-.+ } } @@ -145,7 +145,7 @@ define-command -hidden python-indent-on-new-line %{ # copy '#' comment prefix and following white spaces try %{ execute-keys -draft k s ^\h*#\h* y jgh P } # preserve previous line indent - try %{ execute-keys -draft \; K } + try %{ execute-keys -draft K } # cleanup trailing whitespaces from previous line try %{ execute-keys -draft k s \h+$ d } # indent after line ending with : -- cgit v1.2.3