Merge remote-tracking branch 'arachsys/balance'
This commit is contained in:
commit
8d60e19484
|
@ -105,20 +105,20 @@ define-command -hidden go-indent-on-new-line %~
|
|||
try %{ execute-keys -draft <semicolon>K<a-&> }
|
||||
# cleanup trailing white spaces on the previous line
|
||||
try %{ execute-keys -draft kx s \h+$ <ret>d }
|
||||
try %{
|
||||
try %<
|
||||
try %{ # line comment
|
||||
execute-keys -draft kx s ^\h*// <ret>
|
||||
} catch %{ # block comment
|
||||
execute-keys -draft <a-?> /\* <ret> <a-K>\*/<ret>
|
||||
}
|
||||
} catch %{
|
||||
> catch %<
|
||||
# indent after lines with an unclosed { or (
|
||||
try %< execute-keys -draft [c[({],[)}] <ret> <a-k> \A[({][^\n]*\n[^\n]*\n?\z <ret> j<a-gt> >
|
||||
# indent after a switch's case/default statements
|
||||
try %[ execute-keys -draft kx <a-k> ^\h*(case|default).*:$ <ret> j<a-gt> ]
|
||||
# deindent closing brace(s) when after cursor
|
||||
try %[ execute-keys -draft x <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> ]
|
||||
}
|
||||
>
|
||||
=
|
||||
~
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ provide-module hare %§
|
|||
add-highlighter shared/hare/code/ regex "(=|\+|-|\*|/|<|>|!|\?|&|\||\.\.(\.)?)" 0:operator
|
||||
|
||||
# commands
|
||||
define-command -hidden hare-indent-on-new-line %{ evaluate-commands -draft -itersel %{
|
||||
define-command -hidden hare-indent-on-new-line %[ evaluate-commands -draft -itersel %[
|
||||
# preserve indentation on new lines
|
||||
try %{ execute-keys -draft <semicolon> K <a-&> }
|
||||
# indent after lines ending with { or (
|
||||
|
@ -110,7 +110,7 @@ provide-module hare %§
|
|||
try %[ execute-keys -draft kx <a-k> case\h.*=>\h*$ <ret> j<a-gt> ]
|
||||
# deindent closing brace(s) when after cursor
|
||||
try %[ execute-keys -draft x <a-k> ^\h*[})] <ret> gh / [})] <ret> m <a-S> 1<a-&> ]
|
||||
} }
|
||||
] ]
|
||||
|
||||
define-command -hidden hare-insert-on-new-line %{ evaluate-commands -draft -itersel %{
|
||||
try %{ evaluate-commands -draft -save-regs '/"' %{
|
||||
|
|
|
@ -93,7 +93,7 @@ add-highlighter shared/markdown/inline/text/ regex "\H( {2,})$" 1:+r@meta
|
|||
|
||||
define-command markdown-load-languages -params 1 %{
|
||||
evaluate-commands -draft %{ try %{
|
||||
execute-keys "%arg{1}s```\h*\{?[.=]?\K\w+<ret>" # }
|
||||
execute-keys "%arg{1}1s```\h*\{?[.=]?(\w+)\}?<ret>"
|
||||
evaluate-commands -itersel %{ try %{
|
||||
require-module %val{selection}
|
||||
add-highlighter "shared/markdown/codeblock/%val{selection}" region -match-capture "^(\h*)```\h*(%val{selection}\b|\{[.=]?%val{selection}\})" ^(\h*)``` regions
|
||||
|
|
Loading…
Reference in New Issue
Block a user