From e1de4aa1180d82100b0b3fda8fbec02605551daa Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Wed, 2 Sep 2020 06:33:32 +0200 Subject: [PATCH] python.kak: Do not indent after comments ending in : Fixes #3693 This will not work for lines like the one below but I think that's okay because it does work for most comments. foo() # foo: --- rc/filetype/python.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/filetype/python.kak b/rc/filetype/python.kak index 76cf496a4..2259cbf56 100644 --- a/rc/filetype/python.kak +++ b/rc/filetype/python.kak @@ -156,7 +156,7 @@ define-command -hidden python-indent-on-new-line %< # cleanup trailing whitespaces from previous line try %{ execute-keys -draft k s \h+$ d } # indent after line ending with : - try %{ execute-keys -draft k :$ j } + try %{ execute-keys -draft k :$ ^\h*# j } # deindent closing brace/bracket when after cursor (for arrays and dictionaries) try %< execute-keys -draft ^\h*[}\]] gh / [}\]] m 1 > >