From 5ddc28eaade3985d0d59597f2fd834e692b03a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Ros=C3=A9n?= Date: Thu, 29 Dec 2016 01:38:49 +0100 Subject: [PATCH 2/2] Fix comment-leader auto-insertion Fixes #1074 --- rc/base/haskell.kak | 2 +- rc/base/javascript.kak | 2 +- rc/base/markdown.kak | 2 +- rc/base/ruby.kak | 2 +- rc/base/rust.kak | 2 +- rc/base/scala.kak | 2 +- rc/base/yaml.kak | 2 +- rc/extra/cabal.kak | 2 +- rc/extra/coffee.kak | 2 +- rc/extra/cucumber.kak | 2 +- rc/extra/haml.kak | 2 +- rc/extra/moon.kak | 2 +- rc/extra/php.kak | 2 +- rc/extra/pug.kak | 2 +- rc/extra/ragel.kak | 2 +- rc/extra/sass.kak | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/rc/base/haskell.kak b/rc/base/haskell.kak index bb5fb5c1..a60c3859 100644 --- a/rc/base/haskell.kak +++ b/rc/base/haskell.kak @@ -45,7 +45,7 @@ def -hidden _haskell_indent_on_new_line %{ # filter previous line try %{ exec -draft k : _haskell_filter_around_selections } # copy -- comments prefix and following white spaces - try %{ exec -draft k x s ^\h*\K--\h* y j p } + try %{ exec -draft k x s ^\h*\K--\h* y gh j P } # indent after lines beginning with condition or ending with expression or =( try %{ exec -draft k x ^\h*(if)|(case\h+[\w']+\h+of|do|let|where|[=(])$ j } } diff --git a/rc/base/javascript.kak b/rc/base/javascript.kak index 0ea31df7..353e156b 100644 --- a/rc/base/javascript.kak +++ b/rc/base/javascript.kak @@ -53,7 +53,7 @@ def -hidden _javascript_indent_on_new_line %< # filter previous line try %{ exec -draft k : _javascript_filter_around_selections } # copy // comments prefix and following white spaces - try %{ exec -draft k x s ^\h*\K#\h* y j p } + try %{ exec -draft k x s ^\h*\K#\h* y gh j P } # indent after lines beginning / ending with opener token try %_ exec -draft k x ^\h*[[{]|[[{]$ j _ > diff --git a/rc/base/markdown.kak b/rc/base/markdown.kak index 606bdb1e..9108c9f3 100644 --- a/rc/base/markdown.kak +++ b/rc/base/markdown.kak @@ -131,7 +131,7 @@ def -hidden _markdown_indent_on_new_line %{ # remove trailing white spaces try %{ exec -draft -itersel %{ k s \h+$ d } } # copy block quote(s), list item prefix and following white spaces - try %{ exec -draft k x s ^\h*\K((>\h*)|[*+-])+\h* y j p } + try %{ exec -draft k x s ^\h*\K((>\h*)|[*+-])+\h* y gh j P } } } diff --git a/rc/base/ruby.kak b/rc/base/ruby.kak index 42af2fd7..565c5c85 100644 --- a/rc/base/ruby.kak +++ b/rc/base/ruby.kak @@ -132,7 +132,7 @@ def -hidden _ruby_indent_on_new_line %{ def -hidden _ruby_insert_on_new_line %{ eval -no-hooks -draft -itersel %{ # copy _#_ comment prefix and following white spaces - try %{ exec -draft k x s ^ \h * \K \# \h * y j p } + try %{ exec -draft k x s ^ \h * \K \# \h * y gh j P } # wisely add end structure eval -save-regs x %{ try %{ exec -draft k x s ^ \h + \" x y } catch %{ reg x '' } diff --git a/rc/base/rust.kak b/rc/base/rust.kak index 774b5214..ce3cf6f7 100644 --- a/rc/base/rust.kak +++ b/rc/base/rust.kak @@ -46,7 +46,7 @@ def -hidden _rust_indent_on_new_line %~ # filter previous line try %{ exec -draft k : _rust_filter_around_selections } # copy // comments prefix and following white spaces - try %{ exec -draft k x s ^\h*\K//\h* y j p } + try %{ exec -draft k x s ^\h*\K//\h* y gh j P } # indent after lines ending with { or ( try %[ exec -draft k [{(]\h*$ j ] # align to opening paren of previous line diff --git a/rc/base/scala.kak b/rc/base/scala.kak index 869fc3ec..7081afad 100644 --- a/rc/base/scala.kak +++ b/rc/base/scala.kak @@ -46,7 +46,7 @@ def -hidden _scala_indent_on_new_line %[ # filter previous line try %[ exec -draft k : _scala_filter_around_selections ] # copy // comments prefix and following white spaces - try %[ exec -draft k x s ^\h*\K#\h* y j p ] + try %[ exec -draft k x s ^\h*\K#\h* y gh j P ] # indent after lines ending with { try %[ exec -draft k x \{$ j ] ] diff --git a/rc/base/yaml.kak b/rc/base/yaml.kak index ddf5d7bc..3801a5cc 100644 --- a/rc/base/yaml.kak +++ b/rc/base/yaml.kak @@ -39,7 +39,7 @@ def -hidden _yaml_indent_on_new_line %{ # filter previous line try %{ exec -draft k : _yaml_filter_around_selections } # copy '#' comment prefix and following white spaces - try %{ exec -draft k x s ^\h*\K#\h* y j p } + try %{ exec -draft k x s ^\h*\K#\h* y gh j P } # indent after : try %{ exec -draft k x :$ j } } diff --git a/rc/extra/cabal.kak b/rc/extra/cabal.kak index 453355e4..c8511e29 100644 --- a/rc/extra/cabal.kak +++ b/rc/extra/cabal.kak @@ -36,7 +36,7 @@ def -hidden _cabal_indent_on_new_line %[ # filter previous line try %[ exec -draft k : _cabal_filter_around_selections ] # copy '#' comment prefix and following white spaces - try %[ exec -draft k x s ^\h*\K#\h* y j p ] + try %[ exec -draft k x s ^\h*\K#\h* y gh j P ] # indent after lines ending with { or : try %[ exec -draft k x [:{]$ j ] ] diff --git a/rc/extra/coffee.kak b/rc/extra/coffee.kak index e3541cbf..c888a05e 100644 --- a/rc/extra/coffee.kak +++ b/rc/extra/coffee.kak @@ -60,7 +60,7 @@ def -hidden _coffee_indent_on_new_line %{ # filter previous line try %{ exec -draft k : _coffee_filter_around_selections } # copy '#' comment prefix and following white spaces - try %{ exec -draft k x s ^ \h * \K \# \h * y j p } + try %{ exec -draft k x s ^ \h * \K \# \h * y gh j P } # indent after start structure try %{ exec -draft k x ^ \h * (case|catch|class|else|finally|for|function|if|switch|try|while|with) \b | (=|->) $ j } } diff --git a/rc/extra/cucumber.kak b/rc/extra/cucumber.kak index de69ebaa..4c0e01af 100644 --- a/rc/extra/cucumber.kak +++ b/rc/extra/cucumber.kak @@ -68,7 +68,7 @@ def -hidden _cucumber_indent_on_new_line %{ # filter previous line try %{ exec -draft k : _cucumber_filter_around_selections } # copy '#' comment prefix and following white spaces - try %{ exec -draft k x s ^\h*\K#\h* y j p } + try %{ exec -draft k x s ^\h*\K#\h* y gh j P } # indent after lines containing : try %{ exec -draft k x : j } } diff --git a/rc/extra/haml.kak b/rc/extra/haml.kak index a6531989..7652ee3f 100644 --- a/rc/extra/haml.kak +++ b/rc/extra/haml.kak @@ -45,7 +45,7 @@ def -hidden _haml_indent_on_new_line %{ # filter previous line try %{ exec -draft k : _haml_filter_around_selections } # copy '/' comment prefix and following white spaces - try %{ exec -draft k x s ^\h*\K/\h* y j p } + try %{ exec -draft k x s ^\h*\K/\h* y gh j P } # indent after lines beginning with : or - try %{ exec -draft k x ^\h*[:-] j } } diff --git a/rc/extra/moon.kak b/rc/extra/moon.kak index 9439a0de..82690cd9 100644 --- a/rc/extra/moon.kak +++ b/rc/extra/moon.kak @@ -81,7 +81,7 @@ def -hidden _moon_indent_on_new_line %{ # filter previous line try %{ exec -draft k : _moon_filter_around_selections } # copy -- comment prefix and following white spaces - try %{ exec -draft k x s ^ \h * \K -- \h * y j p } + try %{ exec -draft k x s ^ \h * \K -- \h * y gh j P } # indent after start structure try %{ exec -draft k x ^ \h * (class|else(if)?|for|if|switch|unless|when|while|with) \b | ([:=]|[-=]>) $ j } # deindent after return statements diff --git a/rc/extra/php.kak b/rc/extra/php.kak index 6f522698..33138449 100644 --- a/rc/extra/php.kak +++ b/rc/extra/php.kak @@ -50,7 +50,7 @@ def -hidden _php_indent_on_new_line %< # filter previous line try %{ exec -draft k : _php_filter_around_selections } # copy // comments prefix and following white spaces - try %{ exec -draft k x s ^\h*\K#\h* y j p } + try %{ exec -draft k x s ^\h*\K#\h* y gh j P } # indent after lines beginning / ending with opener token try %_ exec -draft k x ^\h*[[{]|[[{]$ j _ > diff --git a/rc/extra/pug.kak b/rc/extra/pug.kak index d1a37f5f..85282fee 100644 --- a/rc/extra/pug.kak +++ b/rc/extra/pug.kak @@ -56,7 +56,7 @@ def -hidden _pug_indent_on_new_line %{ # filter previous line try %{ exec -draft k : _pug_filter_around_selections } # copy '//', '|', '-' or '(!)=' prefix and following whitespace - try %{ exec -draft k x s ^\h*\K[/|!=-]{1,2}\h* y j p } + try %{ exec -draft k x s ^\h*\K[/|!=-]{1,2}\h* y gh j P } # indent unless we copied something above try %{ exec -draft b s \S g l } } diff --git a/rc/extra/ragel.kak b/rc/extra/ragel.kak index cc934c64..6093aadb 100644 --- a/rc/extra/ragel.kak +++ b/rc/extra/ragel.kak @@ -49,7 +49,7 @@ def -hidden _ragel_indent_on_new_line %< # filter previous line try %{ exec -draft k : _ragel_filter_around_selections } # copy _#_ comment prefix and following white spaces - try %{ exec -draft k x s ^\h*\K#\h* y j p } + try %{ exec -draft k x s ^\h*\K#\h* y gh j P } # indent after lines ending with opener token try %< exec -draft k x [[{(*]$ j > > diff --git a/rc/extra/sass.kak b/rc/extra/sass.kak index 9c0cef76..fe981b46 100644 --- a/rc/extra/sass.kak +++ b/rc/extra/sass.kak @@ -41,7 +41,7 @@ def -hidden _sass_indent_on_new_line %{ # filter previous line try %{ exec -draft k : _sass_filter_around_selections } # copy '/' comment prefix and following white spaces - try %{ exec -draft k x s ^\h*\K/\h* y j p } + try %{ exec -draft k x s ^\h*\K/\h* y gh j P } # avoid indent after properties and comments try %{ exec -draft k x [:/] j } }