Fix comment-leader auto-insertion

Fixes #1074
This commit is contained in:
Dan Rosén 2016-12-29 01:38:49 +01:00
parent 83651e4998
commit 5ddc28eaad
16 changed files with 16 additions and 16 deletions

View File

@ -45,7 +45,7 @@ def -hidden _haskell_indent_on_new_line %{
# filter previous line
try %{ exec -draft k : _haskell_filter_around_selections <ret> }
# copy -- comments prefix and following white spaces
try %{ exec -draft k x s ^\h*\K--\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K--\h* <ret> y gh j P }
# indent after lines beginning with condition or ending with expression or =(
try %{ exec -draft <space> k x <a-k> ^\h*(if)|(case\h+[\w']+\h+of|do|let|where|[=(])$ <ret> j <a-gt> }
}

View File

@ -53,7 +53,7 @@ def -hidden _javascript_indent_on_new_line %<
# filter previous line
try %{ exec -draft k : _javascript_filter_around_selections <ret> }
# copy // comments prefix and following white spaces
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
# indent after lines beginning / ending with opener token
try %_ exec -draft k x <a-k> ^\h*[[{]|[[{]$ <ret> j <a-gt> _
>

View File

@ -131,7 +131,7 @@ def -hidden _markdown_indent_on_new_line %{
# remove trailing white spaces
try %{ exec -draft -itersel %{ k<a-x> s \h+$ <ret> d } }
# copy block quote(s), list item prefix and following white spaces
try %{ exec -draft k x s ^\h*\K((>\h*)|[*+-])+\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K((>\h*)|[*+-])+\h* <ret> y gh j P }
}
}

View File

@ -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 * <ret> y j p }
try %{ exec -draft k x s ^ \h * \K \# \h * <ret> y gh j P }
# wisely add end structure
eval -save-regs x %{
try %{ exec -draft k x s ^ \h + <ret> \" x y } catch %{ reg x '' }

View File

@ -46,7 +46,7 @@ def -hidden _rust_indent_on_new_line %~
# filter previous line
try %{ exec -draft k : _rust_filter_around_selections <ret> }
# copy // comments prefix and following white spaces
try %{ exec -draft k x s ^\h*\K//\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K//\h* <ret> y gh j P }
# indent after lines ending with { or (
try %[ exec -draft k <a-x> <a-k> [{(]\h*$ <ret> j <a-gt> ]
# align to opening paren of previous line

View File

@ -46,7 +46,7 @@ def -hidden _scala_indent_on_new_line %[
# filter previous line
try %[ exec -draft k : _scala_filter_around_selections <ret> ]
# copy // comments prefix and following white spaces
try %[ exec -draft k x s ^\h*\K#\h* <ret> y j p ]
try %[ exec -draft k x s ^\h*\K#\h* <ret> y gh j P ]
# indent after lines ending with {
try %[ exec -draft k x <a-k> \{$ <ret> j <a-gt> ]
]

View File

@ -39,7 +39,7 @@ def -hidden _yaml_indent_on_new_line %{
# filter previous line
try %{ exec -draft k : _yaml_filter_around_selections <ret> }
# copy '#' comment prefix and following white spaces
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
# indent after :
try %{ exec -draft <space> k x <a-k> :$ <ret> j <a-gt> }
}

View File

@ -36,7 +36,7 @@ def -hidden _cabal_indent_on_new_line %[
# filter previous line
try %[ exec -draft k : _cabal_filter_around_selections <ret> ]
# copy '#' comment prefix and following white spaces
try %[ exec -draft k x s ^\h*\K#\h* <ret> y j p ]
try %[ exec -draft k x s ^\h*\K#\h* <ret> y gh j P ]
# indent after lines ending with { or :
try %[ exec -draft <space> k x <a-k> [:{]$ <ret> j <a-gt> ]
]

View File

@ -60,7 +60,7 @@ def -hidden _coffee_indent_on_new_line %{
# filter previous line
try %{ exec -draft k : _coffee_filter_around_selections <ret> }
# copy '#' comment prefix and following white spaces
try %{ exec -draft k x s ^ \h * \K \# \h * <ret> y j p }
try %{ exec -draft k x s ^ \h * \K \# \h * <ret> y gh j P }
# indent after start structure
try %{ exec -draft k x <a-k> ^ \h * (case|catch|class|else|finally|for|function|if|switch|try|while|with) \b | (=|->) $ <ret> j <a-gt> }
}

View File

@ -68,7 +68,7 @@ def -hidden _cucumber_indent_on_new_line %{
# filter previous line
try %{ exec -draft k : _cucumber_filter_around_selections <ret> }
# copy '#' comment prefix and following white spaces
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
# indent after lines containing :
try %{ exec -draft <space> k x <a-k> : <ret> j <a-gt> }
}

View File

@ -45,7 +45,7 @@ def -hidden _haml_indent_on_new_line %{
# filter previous line
try %{ exec -draft k : _haml_filter_around_selections <ret> }
# copy '/' comment prefix and following white spaces
try %{ exec -draft k x s ^\h*\K/\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K/\h* <ret> y gh j P }
# indent after lines beginning with : or -
try %{ exec -draft k x <a-k> ^\h*[:-] <ret> j <a-gt> }
}

View File

@ -81,7 +81,7 @@ def -hidden _moon_indent_on_new_line %{
# filter previous line
try %{ exec -draft k : _moon_filter_around_selections <ret> }
# copy -- comment prefix and following white spaces
try %{ exec -draft k x s ^ \h * \K -- \h * <ret> y j p }
try %{ exec -draft k x s ^ \h * \K -- \h * <ret> y gh j P }
# indent after start structure
try %{ exec -draft k x <a-k> ^ \h * (class|else(if)?|for|if|switch|unless|when|while|with) \b | ([:=]|[-=]>) $ <ret> j <a-gt> }
# deindent after return statements

View File

@ -50,7 +50,7 @@ def -hidden _php_indent_on_new_line %<
# filter previous line
try %{ exec -draft k : _php_filter_around_selections <ret> }
# copy // comments prefix and following white spaces
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
# indent after lines beginning / ending with opener token
try %_ exec -draft k x <a-k> ^\h*[[{]|[[{]$ <ret> j <a-gt> _
>

View File

@ -56,7 +56,7 @@ def -hidden _pug_indent_on_new_line %{
# filter previous line
try %{ exec -draft k : _pug_filter_around_selections <ret> }
# copy '//', '|', '-' or '(!)=' prefix and following whitespace
try %{ exec -draft k x s ^\h*\K[/|!=-]{1,2}\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K[/|!=-]{1,2}\h* <ret> y gh j P }
# indent unless we copied something above
try %{ exec -draft <a-gt> <space> b s \S <ret> g l <a-lt> }
}

View File

@ -49,7 +49,7 @@ def -hidden _ragel_indent_on_new_line %<
# filter previous line
try %{ exec -draft k : _ragel_filter_around_selections <ret> }
# copy _#_ comment prefix and following white spaces
try %{ exec -draft k x s ^\h*\K#\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K#\h* <ret> y gh j P }
# indent after lines ending with opener token
try %< exec -draft k x <a-k> [[{(*]$ <ret> j <a-gt> >
>

View File

@ -41,7 +41,7 @@ def -hidden _sass_indent_on_new_line %{
# filter previous line
try %{ exec -draft k : _sass_filter_around_selections <ret> }
# copy '/' comment prefix and following white spaces
try %{ exec -draft k x s ^\h*\K/\h* <ret> y j p }
try %{ exec -draft k x s ^\h*\K/\h* <ret> y gh j P }
# avoid indent after properties and comments
try %{ exec -draft k x <a-K> [:/] <ret> j <a-gt> }
}