From 80d661e6a70a8e03ba8e1ee0e0ae8c3de5b8da03 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 29 Sep 2017 10:39:59 +0800 Subject: [PATCH] rc/: More consistent uses of regex syntax Always use \A \z for subject start/end, always \b for word boundaries --- rc/base/autowrap.kak | 2 +- rc/base/css.kak | 2 +- rc/base/d.kak | 8 ++++---- rc/base/fish.kak | 6 +++--- rc/base/go.kak | 8 ++++---- rc/base/haskell.kak | 2 +- rc/base/html.kak | 2 +- rc/base/java.kak | 8 ++++---- rc/base/javascript.kak | 2 +- rc/base/json.kak | 2 +- rc/base/lisp.kak | 2 +- rc/base/lua.kak | 4 ++-- rc/base/perl.kak | 8 ++++---- rc/base/ruby.kak | 8 ++++---- rc/base/rust.kak | 6 +++--- rc/base/scala.kak | 2 +- rc/base/swift.kak | 20 ++++++++++---------- rc/core/c-family.kak | 12 ++++++------ rc/core/doc.kak | 2 +- rc/core/make.kak | 4 ++-- rc/extra/cabal.kak | 4 ++-- rc/extra/clang.kak | 4 ++-- rc/extra/elm.kak | 2 +- rc/extra/hbs.kak | 12 ++++++------ rc/extra/jedi.kak | 2 +- rc/extra/kickstart.kak | 4 ++-- rc/extra/modeline.kak | 2 +- rc/extra/moon.kak | 6 +++--- rc/extra/php.kak | 2 +- rc/extra/ragel.kak | 4 ++-- rc/extra/tupfile.kak | 2 +- 31 files changed, 77 insertions(+), 77 deletions(-) diff --git a/rc/base/autowrap.kak b/rc/base/autowrap.kak index 77f507c8..d723c93e 100644 --- a/rc/base/autowrap.kak +++ b/rc/base/autowrap.kak @@ -17,7 +17,7 @@ def -hidden autowrap-cursor %{ eval -save-regs '/"|^@m' %{ reg m "%val{selections_desc}" ## if we're adding characters past the limit, just wrap them around - exec -draft ".{%opt{autowrap_column}}\h*[^\s]*1s(\h+)[^\h]*\'c" + exec -draft ".{%opt{autowrap_column}}\h*[^\s]*1s(\h+)[^\h]*\zc" } catch %{ ## if we're adding characters in the middle of a sentence, use ## the `fmtcmd` command to wrap the entire paragraph diff --git a/rc/base/css.kak b/rc/base/css.kak index 095835de..391400ca 100644 --- a/rc/base/css.kak +++ b/rc/base/css.kak @@ -57,7 +57,7 @@ def -hidden css-indent-on-new-line %[ def -hidden css-indent-on-closing-curly-brace %[ eval -draft -itersel %[ # align to opening curly brace when alone on a line - try %[ exec -draft ^\h+\}$ m s \`|.\' 1 ] + try %[ exec -draft ^\h+\}$ m s \A|.\z 1 ] ] ] diff --git a/rc/base/d.kak b/rc/base/d.kak index 92fbd64f..b4a1264e 100644 --- a/rc/base/d.kak +++ b/rc/base/d.kak @@ -90,24 +90,24 @@ def -hidden d-indent-on-new-line %~ # cleanup trailing white spaces on the previous line try %{ exec -draft k s \h+$ d } # align to opening paren of previous line - try %{ exec -draft [( \`\([^\n]+\n[^\n]*\n?\' s \`\(\h*.|.\' '' & } + try %{ exec -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } # copy // comments prefix try %{ exec -draft \;k s ^\h*\K/{2,} yP } # indent after a switch's case/default statements try %[ exec -draft k ^\h*(case|default).*:$ j ] # indent after if|else|while|for - try %[ exec -draft \;)MB \`(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\' s \`|.\' 11 ] + try %[ exec -draft \;)MB \A(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\z s \A|.\z 11 ] = ~ def -hidden d-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren - try %[ exec -draft -itersel h)M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] + try %[ exec -draft -itersel h)M \A\(.*\)\h*\n\h*\{\z s \A|.\z 1 ] ] def -hidden d-indent-on-closing-curly-brace %[ # align to opening curly brace when alone on a line - try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] + try %[ exec -itersel -draft ^\h+\}$hms\A|.\z1 ] ] # Initialization diff --git a/rc/base/fish.kak b/rc/base/fish.kak index a417b1ea..626d2199 100644 --- a/rc/base/fish.kak +++ b/rc/base/fish.kak @@ -39,9 +39,9 @@ def -hidden fish-filter-around-selections %{ def -hidden fish-indent-on-char %{ eval -no-hooks -draft -itersel %{ # align middle and end structures to start and indent when necessary - try %{ exec -draft ^\h*(else)$^\h*(if)s\A|\Z' } - try %{ exec -draft ^\h*(end)$^\h*(begin|for|function|if|switch|while)s\A|\Z' } - try %{ exec -draft ^\h*(case)$^\h*(switch)s\A|\Z'' } + try %{ exec -draft ^\h*(else)$^\h*(if)s\A|\z' } + try %{ exec -draft ^\h*(end)$^\h*(begin|for|function|if|switch|while)s\A|\z' } + try %{ exec -draft ^\h*(case)$^\h*(switch)s\A|\z'' } } } diff --git a/rc/base/go.kak b/rc/base/go.kak index b726d105..a6089563 100644 --- a/rc/base/go.kak +++ b/rc/base/go.kak @@ -62,24 +62,24 @@ def -hidden go-indent-on-new-line %~ # cleanup trailing white spaces on the previous line try %{ exec -draft k s \h+$ d } # align to opening paren of previous line - try %{ exec -draft [( \`\([^\n]+\n[^\n]*\n?\' s \`\(\h*.|.\' '' & } + try %{ exec -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } # copy // comments prefix try %{ exec -draft \;k s ^\h*\K/{2,} yP } # indent after a switch's case/default statements try %[ exec -draft k ^\h*(case|default).*:$ j ] # indent after if|else|while|for - try %[ exec -draft \;)MB \`(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\' s \`|.\' 11 ] + try %[ exec -draft \;)MB \A(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\z s \A|.\z 11 ] = ~ def -hidden go-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren - try %[ exec -draft -itersel h)M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] + try %[ exec -draft -itersel h)M \A\(.*\)\h*\n\h*\{\z s \A|.\z 1 ] ] def -hidden go-indent-on-closing-curly-brace %[ # align to opening curly brace when alone on a line - try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] + try %[ exec -itersel -draft ^\h+\}$hms\A|.\z1 ] ] # Initialization diff --git a/rc/base/haskell.kak b/rc/base/haskell.kak index 84ff0460..f3a7abef 100644 --- a/rc/base/haskell.kak +++ b/rc/base/haskell.kak @@ -85,7 +85,7 @@ def -hidden haskell-indent-on-new-line %{ # preserve previous line indent try %{ exec -draft \; K } # align to first clause - try %{ exec -draft \; k x X s ^\h*(if|then|else)?\h*(([\w']+\h+)+=)?\h*(case\h+[\w']+\h+of|do|let|where)\h+\K.* s \`|.\' & } + try %{ exec -draft \; k x X s ^\h*(if|then|else)?\h*(([\w']+\h+)+=)?\h*(case\h+[\w']+\h+of|do|let|where)\h+\K.* s \A|.\z & } # filter previous line try %{ exec -draft k : haskell-filter-around-selections } # indent after lines beginning with condition or ending with expression or =( diff --git a/rc/base/html.kak b/rc/base/html.kak index 4b7380f0..385b2667 100644 --- a/rc/base/html.kak +++ b/rc/base/html.kak @@ -47,7 +47,7 @@ def -hidden html-filter-around-selections %{ def -hidden html-indent-on-char %{ eval -draft -itersel %{ # align closing tag to opening when alone on a line - try %{ exec -draft s ^\h+$ 1 s \`|.\' 1 } + try %{ exec -draft s ^\h+$ 1 s \A|.\z 1 } } } diff --git a/rc/base/java.kak b/rc/base/java.kak index 8e835fff..c8485b10 100644 --- a/rc/base/java.kak +++ b/rc/base/java.kak @@ -27,24 +27,24 @@ def -hidden java-indent-on-new-line %~ # cleanup trailing white spaces on the previous line try %{ exec -draft k s \h+$ d } # align to opening paren of previous line - try %{ exec -draft [( \`\([^\n]+\n[^\n]*\n?\' s \`\(\h*.|.\' '' & } + try %{ exec -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } # copy // comments prefix try %{ exec -draft \;k s ^\h*\K/{2,} yP } # indent after a switch's case/default statements try %[ exec -draft k ^\h*(case|default).*:$ j ] # indent after keywords - try %[ exec -draft \;)MB \`(if|else|while|for|try|catch)\h*\(.*\)\h*\n\h*\n?\' s \`|.\' 11 ] + try %[ exec -draft \;)MB \A(if|else|while|for|try|catch)\h*\(.*\)\h*\n\h*\n?\z s \A|.\z 11 ] = ~ def -hidden java-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren - try %[ exec -draft -itersel h)M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] + try %[ exec -draft -itersel h)M \A\(.*\)\h*\n\h*\{\z s \A|.\z 1 ] ] def -hidden java-indent-on-closing-curly-brace %[ # align to opening curly brace when alone on a line - try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] + try %[ exec -itersel -draft ^\h+\}$hms\A|.\z1 ] ] # Initialization diff --git a/rc/base/javascript.kak b/rc/base/javascript.kak index b1983694..d14dd263 100644 --- a/rc/base/javascript.kak +++ b/rc/base/javascript.kak @@ -47,7 +47,7 @@ def -hidden javascript-filter-around-selections %{ def -hidden javascript-indent-on-char %< eval -draft -itersel %< # align closer token to its opener when alone on a line - try %/ exec -draft ^\h+[]}]$ m s \`|.\' 1 / + try %/ exec -draft ^\h+[]}]$ m s \A|.\z 1 / > > diff --git a/rc/base/json.kak b/rc/base/json.kak index c8f2ebc2..997c612a 100644 --- a/rc/base/json.kak +++ b/rc/base/json.kak @@ -29,7 +29,7 @@ def -hidden json-filter-around-selections %{ def -hidden json-indent-on-char %< eval -draft -itersel %< # align closer token to its opener when alone on a line - try %< exec -draft ^\h+[]}]$ m s \`|.\' 1 > + try %< exec -draft ^\h+[]}]$ m s \A|.\z 1 > > > diff --git a/rc/base/lisp.kak b/rc/base/lisp.kak index 745f77ca..2b806b70 100644 --- a/rc/base/lisp.kak +++ b/rc/base/lisp.kak @@ -36,7 +36,7 @@ def -hidden lisp-indent-on-new-line %{ # preserve previous line indent try %{ exec -draft \; K } # indent when matches opening paren - try %{ exec -draft [( \`\([^\n]+\n[^\n]*\n?\' \; } + try %{ exec -draft [( \A\([^\n]+\n[^\n]*\n?\z \; } } } diff --git a/rc/base/lua.kak b/rc/base/lua.kak index 5666fc8a..f37e7039 100644 --- a/rc/base/lua.kak +++ b/rc/base/lua.kak @@ -61,8 +61,8 @@ def -hidden lua-filter-around-selections %{ def -hidden lua-indent-on-char %{ eval -no-hooks -draft -itersel %{ # align middle and end structures to start and indent when necessary, elseif is already covered by else - try %{ exec -draft ^\h*(else)$^\h*(if)s\A|\Z' } - try %{ exec -draft ^\h*(end)$^\h*(for|function|if|while)s\A|\Z' } + try %{ exec -draft ^\h*(else)$^\h*(if)s\A|\z' } + try %{ exec -draft ^\h*(end)$^\h*(for|function|if|while)s\A|\z' } } } diff --git a/rc/base/perl.kak b/rc/base/perl.kak index fd53a901..7ba1e14b 100644 --- a/rc/base/perl.kak +++ b/rc/base/perl.kak @@ -79,24 +79,24 @@ def -hidden perl-indent-on-new-line %~ # cleanup trailing white spaces on the previous line try %{ exec -draft k s \h+$ d } # align to opening paren of previous line - try %{ exec -draft [( \`\([^\n]+\n[^\n]*\n?\' s \`\(\h*.|.\' '' & } + try %{ exec -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z '' & } # copy // comments prefix try %{ exec -draft \;k s ^\h*\K/{2,} yP } # indent after a switch's case/default statements try %[ exec -draft k ^\h*(case|default).*:$ j ] # indent after if|else|while|for - try %[ exec -draft \;)MB \`(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\' s \`|.\' 11 ] + try %[ exec -draft \;)MB \A(if|else|while|for)\h*\(.*\)\h*\n\h*\n?\z s \A|.\z 11 ] = ~ def -hidden perl-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren - try %[ exec -draft -itersel h)M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] + try %[ exec -draft -itersel h)M \A\(.*\)\h*\n\h*\{\' s \A|.\z 1 ] ] def -hidden perl-indent-on-closing-curly-brace %[ # align to opening curly brace when alone on a line - try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] + try %[ exec -itersel -draft ^\h+\}$hms\A|.\z1 ] ] # Initialization diff --git a/rc/base/ruby.kak b/rc/base/ruby.kak index 48d006e6..494385a2 100644 --- a/rc/base/ruby.kak +++ b/rc/base/ruby.kak @@ -111,10 +111,10 @@ def -hidden ruby-filter-around-selections %{ def -hidden ruby-indent-on-char %{ eval -no-hooks -draft -itersel %{ # align middle and end structures to start - try %{ exec -draft ^ \h * (else|elsif) $ ^ \h * (if) s \A | \Z \' } - try %{ exec -draft ^ \h * (when) $ ^ \h * (case) s \A | \Z \' } - try %{ exec -draft ^ \h * (rescue) $ ^ \h * (begin) s \A | \Z \' } - try %{ exec -draft ^ \h * (end) $ ^ \h * (begin|case|class|def|do|for|if|module|unless|until|while) s \A | \Z \' } + try %{ exec -draft ^ \h * (else|elsif) $ ^ \h * (if) s \A | \z \' } + try %{ exec -draft ^ \h * (when) $ ^ \h * (case) s \A | \z \' } + try %{ exec -draft ^ \h * (rescue) $ ^ \h * (begin) s \A | \z \' } + try %{ exec -draft ^ \h * (end) $ ^ \h * (begin|case|class|def|do|for|if|module|unless|until|while) s \A | \z \' } } } diff --git a/rc/base/rust.kak b/rc/base/rust.kak index e352d7e4..2c641fa0 100644 --- a/rc/base/rust.kak +++ b/rc/base/rust.kak @@ -50,21 +50,21 @@ def -hidden rust-indent-on-new-line %~ # indent after lines ending with { or ( try %[ exec -draft k [{(]\h*$ j ] # align to opening paren of previous line - try %{ exec -draft [( \`\([^\n]+\n[^\n]*\n?\' s \`\(\h*.|.\' & } + try %{ exec -draft [( \A\([^\n]+\n[^\n]*\n?\z s \A\(\h*.|.\z & } > ~ def -hidden rust-indent-on-opening-curly-brace %[ eval -draft -itersel %_ # align indent with opening paren when { is entered on a new line after the closing paren - try %[ exec -draft h ) M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] + try %[ exec -draft h ) M \A\(.*\)\h*\n\h*\{\z s \A|.\z 1 ] _ ] def -hidden rust-indent-on-closing-curly-brace %[ eval -draft -itersel %_ # align to opening curly brace when alone on a line - try %[ exec -draft ^\h+\}$ h m s \`|.\' 1 ] + try %[ exec -draft ^\h+\}$ h m s \A|.\z 1 ] _ ] diff --git a/rc/base/scala.kak b/rc/base/scala.kak index 0aee0a97..92cbc5e8 100644 --- a/rc/base/scala.kak +++ b/rc/base/scala.kak @@ -55,7 +55,7 @@ def -hidden scala-indent-on-new-line %[ def -hidden scala-indent-on-closing-curly-brace %[ eval -draft -itersel %[ # align to opening curly brace when alone on a line - try %[ exec -draft ^\h+\}$ m s \`|.\' 1 ] + try %[ exec -draft ^\h+\}$ m s \A|.\z 1 ] ] ] diff --git a/rc/base/swift.kak b/rc/base/swift.kak index 5cb2cba3..91028e61 100644 --- a/rc/base/swift.kak +++ b/rc/base/swift.kak @@ -10,18 +10,18 @@ add-highlighter -group / regions -default code swift \ add-highlighter -group /swift/string fill string add-highlighter -group /swift/comment fill comment -add-highlighter -group /swift/comment regex "\<(TODO|XXX|MARK)\>" 0:red +add-highlighter -group /swift/comment regex "\b(TODO|XXX|MARK)\b" 0:red -add-highlighter -group /swift/code regex %{\<(true|false|nil)\>|\<-?(?!\$)\d+[fdiu]?|'((\\.)?|[^'\\])'} 0:value -add-highlighter -group /swift/code regex "\<(let|var|while|in|for|if|else|do|switch|case|default|break|continue|return|try|catch|throw|new|delete|and|or|not|operator|explicit|func|import|return|init|deinit|get|set)\>" 0:keyword -add-highlighter -group /swift/code regex "\[!?]?" 0:keyword -add-highlighter -group /swift/code regex "(\$[0-9])\>" 0:keyword -add-highlighter -group /swift/code regex "\<(const|mutable|auto|namespace|inline|static|volatile|class|struct|enum|union|public|protected|private|typedef|virtual|friend|extern|typename|override|final|required|convenience|dynamic)\>" 0:attribute +add-highlighter -group /swift/code regex %{\b(true|false|nil)\b|\b-?(?!\$)\d+[fdiu]?|'((\\.)?|[^'\\])'} 0:value +add-highlighter -group /swift/code regex "\b(let|var|while|in|for|if|else|do|switch|case|default|break|continue|return|try|catch|throw|new|delete|and|or|not|operator|explicit|func|import|return|init|deinit|get|set)\b" 0:keyword +add-highlighter -group /swift/code regex "\bas\b[!?]?" 0:keyword +add-highlighter -group /swift/code regex "(\$[0-9])\b" 0:keyword +add-highlighter -group /swift/code regex "\b(const|mutable|auto|namespace|inline|static|volatile|class|struct|enum|union|public|protected|private|typedef|virtual|friend|extern|typename|override|final|required|convenience|dynamic)\b" 0:attribute -add-highlighter -group /swift/code regex "\<(self|nil|id|super)\>" 0:value -add-highlighter -group /swift/code regex "\<(Bool|String|UInt|UInt16|UInt32|UInt64|UInt8)\>" 0:type -add-highlighter -group /swift/code regex "\<(IBAction|IBOutlet)\>" 0:attribute -add-highlighter -group /swift/code regex "@\w+\>" 0:attribute +add-highlighter -group /swift/code regex "\b(self|nil|id|super)\b" 0:value +add-highlighter -group /swift/code regex "\b(Bool|String|UInt|UInt16|UInt32|UInt64|UInt8)\b" 0:type +add-highlighter -group /swift/code regex "\b(IBAction|IBOutlet)\b" 0:attribute +add-highlighter -group /swift/code regex "@\w+\b" 0:attribute hook -group swift-highlight global WinSetOption filetype=swift %{ add-highlighter ref swift } hook -group swift-highlight global WinSetOption filetype=(?!swift).* %{ remove-highlighter swift } diff --git a/rc/core/c-family.kak b/rc/core/c-family.kak index 54b46a66..8f89c3d1 100644 --- a/rc/core/c-family.kak +++ b/rc/core/c-family.kak @@ -32,7 +32,7 @@ def -hidden c-family-indent-on-newline %< eval -draft -itersel %< exec \; try %< # if previous line closed a paren, copy indent of the opening paren line - exec -draft k 1s(\))(\h+\w+)*\h*(\;\h*)?$ mJ s\`|.\' 1 + exec -draft k 1s(\))(\h+\w+)*\h*(\;\h*)?$ mJ s\A|.\z 1 > catch %< # else indent new lines with the same level as the previous one exec -draft K @@ -51,7 +51,7 @@ def -hidden c-family-indent-on-newline %< eval -draft -itersel %< # Go to opening parenthesis and opening brace, then select the most nested one try %< try %< exec [bZ[B > catch %< exec [B > > # Validate selection and get first and last char - exec \`[{(](\h*\S+)+\n L s\`|.\' + exec \A[{(](\h*\S+)+\n L s\A|.\z # Remove eventual indent from new line try %< exec -draft s\h+ d > # Now align that new line with the opening parenthesis/brace @@ -61,17 +61,17 @@ def -hidden c-family-indent-on-newline %< eval -draft -itersel %< def -hidden c-family-indent-on-opening-curly-brace %[ # align indent with opening paren when { is entered on a new line after the closing paren - try %[ exec -draft -itersel h)M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] + try %[ exec -draft -itersel h)M \A\(.*\)\h*\n\h*\{\z s \A|.\z 1 ] ] def -hidden c-family-indent-on-closing-curly-brace %[ # align to opening curly brace when alone on a line - try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] + try %[ exec -itersel -draft ^\h+\}$hms\A|.\z1 ] ] def -hidden c-family-insert-on-closing-curly-brace %[ # add a semicolon after a closing brace if part of a class, union or struct definition - try %[ exec -itersel -draft hmB\`\h*(class|struct|union|enum) a\; ] + try %[ exec -itersel -draft hmB\A\h*(class|struct|union|enum) a\; ] ] def -hidden c-family-insert-on-newline %[ eval -draft %[ @@ -94,7 +94,7 @@ def -hidden c-family-insert-on-newline %[ eval -draft %[ exec -draft k ^(\h*/\*|\h+\*(?!/)) # find comment opening, validate it was not closed, and check its using star prefixes - exec -draft /\* \*/ \`\h*/\*([^\n]*\n\h*\*)*[^\n]*\n\h*.\' + exec -draft /\* \*/ \A\h*/\*([^\n]*\n\h*\*)*[^\n]*\n\h*.\z try %[ # if the previous line is opening the comment, insert star preceeded by space diff --git a/rc/core/doc.kak b/rc/core/doc.kak index 5d967f11..84c56c6e 100644 --- a/rc/core/doc.kak +++ b/rc/core/doc.kak @@ -24,7 +24,7 @@ def -hidden -params 1..2 doc-open %{ if [ $# -gt 1 ]; then needle=$(printf %s\\n "$2" | sed 's,<,,g') - printf %s\\n "try %{ exec '%(?i)^\h+[^\n]*?\Q${needle}\E\'' } catch %{ exec gg }" + printf %s\\n "try %{ exec '%(?i)^\h+[^\n]*?\Q${needle}\E\z' } catch %{ exec gg }" fi else printf %s\\n "echo -markup %{{Error}doc '$@' failed: see *debug* buffer for details}" diff --git a/rc/core/make.kak b/rc/core/make.kak index 99eb958e..6da7f143 100644 --- a/rc/core/make.kak +++ b/rc/core/make.kak @@ -51,11 +51,11 @@ def -hidden make-jump %{ try %{ exec gl "Entering directory" # Try to parse the error into capture groups, failing on absolute paths - exec s "Entering directory '([^']+)'.*\n([^:/][^:]*):(\d+):(?:(\d+):)?([^\n]+)\'" l + exec s "Entering directory '([^']+)'.*\n([^:/][^:]*):(\d+):(?:(\d+):)?([^\n]+)\z" l set buffer make_current_error_line %val{cursor_line} eval -try-client %opt{jumpclient} "edit -existing %reg{1}/%reg{2} %reg{3} %reg{4}; echo -markup %{{Information}%reg{5}}; try %{ focus }" } catch %{ - exec s "((?:\w:)?[^:]+):(\d+):(?:(\d+):)?([^\n]+)\'" l + exec s "((?:\w:)?[^:]+):(\d+):(?:(\d+):)?([^\n]+)\z" l set buffer make_current_error_line %val{cursor_line} eval -try-client %opt{jumpclient} "edit -existing %reg{1} %reg{2} %reg{3}; echo -markup %{{Information}%reg{4}}; try %{ focus }" } diff --git a/rc/extra/cabal.kak b/rc/extra/cabal.kak index 5a64d978..edbbbde1 100644 --- a/rc/extra/cabal.kak +++ b/rc/extra/cabal.kak @@ -45,14 +45,14 @@ def -hidden cabal-indent-on-new-line %[ def -hidden cabal-indent-on-opening-curly-brace %[ eval -draft -itersel %[ # align indent with opening paren when { is entered on a new line after the closing paren - try %[ exec -draft h ) M \`\(.*\)\h*\n\h*\{\' s \`|.\' 1 ] + try %[ exec -draft h ) M \A\(.*\)\h*\n\h*\{\z s \A|.\z 1 ] ] ] def -hidden cabal-indent-on-closing-curly-brace %[ eval -draft -itersel %[ # align to opening curly brace when alone on a line - try %[ exec -draft ^\h+\}$ h m s \`|.\' 1 ] + try %[ exec -draft ^\h+\}$ h m s \A|.\z 1 ] ] ] diff --git a/rc/extra/clang.kak b/rc/extra/clang.kak index fbc822e1..ba618b47 100644 --- a/rc/extra/clang.kak +++ b/rc/extra/clang.kak @@ -105,7 +105,7 @@ def clang-complete -docstring "Complete the current selection" %{ clang-parse -c def -hidden clang-show-completion-info %[ try %[ eval -draft %[ - exec {( ^\( b \`\w+\' + exec {( ^\( b \A\w+\z %sh[ desc=$(printf %s\\n "${kak_opt_clang_completions}" | sed -e "{ s/\([^\\]\):/\1\n/g }" | sed -ne "/^${kak_selection}|/ { s/^[^|]\+|//; s/|.*$//; s/\\\:/:/g; p }") if [ -n "$desc" ]; then @@ -118,7 +118,7 @@ def clang-enable-autocomplete -docstring "Enable automatic clang completion" %{ set window completers "option=clang_completions:%opt{completers}" hook window -group clang-autocomplete InsertIdle .* %{ try %{ - exec -draft (\.|->|::).\' + exec -draft (\.|->|::).\z echo 'completing...' clang-complete } diff --git a/rc/extra/elm.kak b/rc/extra/elm.kak index aee90201..15913197 100644 --- a/rc/extra/elm.kak +++ b/rc/extra/elm.kak @@ -45,7 +45,7 @@ def -hidden elm-indent-on-new-line %{ # preserve previous line indent try %{ exec -draft \; K } # align to first clause - try %{ exec -draft \; k x X s ^\h*(if|then|else)?\h*(([\w']+\h+)+=)?\h*(case\h+[\w']+\h+of|let)\h+\K.* s \`|.\' & } + try %{ exec -draft \; k x X s ^\h*(if|then|else)?\h*(([\w']+\h+)+=)?\h*(case\h+[\w']+\h+of|let)\h+\K.* s \A|.\z & } # filter previous line try %{ exec -draft k : elm-filter-around-selections } # indent after lines beginning with condition or ending with expression or =( diff --git a/rc/extra/hbs.kak b/rc/extra/hbs.kak index b95a18eb..cf693a1c 100644 --- a/rc/extra/hbs.kak +++ b/rc/extra/hbs.kak @@ -12,19 +12,19 @@ hook global BufCreate .*[.](hbs) %{ # ‾‾‾‾‾‾‾‾‾‾‾‾ add-highlighter -group / regions -default html hbs \ - comment {{!-- --}} '' \ - comment {{! }} '' \ - block-expression {{ }} '' + comment \{\{!-- --\}\} '' \ + comment \{\{! \}\} '' \ + block-expression \{\{ \}\} '' add-highlighter -group /hbs/html ref html add-highlighter -group /hbs/comment fill comment -add-highlighter -group /hbs/block-expression regex {{((#|/|)(\w|-)+) 1:meta +add-highlighter -group /hbs/block-expression regex \{\{((#|/|)(\w|-)+) 1:meta # some hbs tags have a special meaning -add-highlighter -group /hbs/block-expression regex {{((#|/|)(if|else|unless|with|lookup|log)) 1:keyword +add-highlighter -group /hbs/block-expression regex \{\{((#|/|)(if|else|unless|with|lookup|log)) 1:keyword # 'each' is special as it really is two words 'each' and 'as' -add-highlighter -group /hbs/block-expression regex {{((#|/|)((each).*(as))) 2:keyword 4:keyword 5:keyword +add-highlighter -group /hbs/block-expression regex \{\{((#|/|)((each).*(as))) 2:keyword 4:keyword 5:keyword add-highlighter -group /hbs/block-expression regex ((\w|-)+)= 1:attribute diff --git a/rc/extra/jedi.kak b/rc/extra/jedi.kak index 6d39544b..cf3c35f5 100644 --- a/rc/extra/jedi.kak +++ b/rc/extra/jedi.kak @@ -33,7 +33,7 @@ def jedi-complete -docstring "Complete the current selection" %{ def jedi-enable-autocomplete -docstring "Add jedi completion candidates to the completer" %{ set window completers "option=jedi_completions:%opt{completers}" hook window -group jedi-autocomplete InsertIdle .* %{ try %{ - exec -draft \..\' + exec -draft \..\z echo 'completing...' jedi-complete } } diff --git a/rc/extra/kickstart.kak b/rc/extra/kickstart.kak index 82bff4fa..7c47c9ca 100644 --- a/rc/extra/kickstart.kak +++ b/rc/extra/kickstart.kak @@ -19,9 +19,9 @@ add-highlighter -group /kickstart/double_string fill string add-highlighter -group /kickstart/packages regex "^\h*[\w-]*" 0:value add-highlighter -group /kickstart/packages regex "#[^\n]*" 0:comment add-highlighter -group /kickstart/packages regex "^\h*@\^?[\h\w-]*" 0:attribute -add-highlighter -group /kickstart/packages regex '\`\h*\K%packages\b' 0:type +add-highlighter -group /kickstart/packages regex '\A\h*\K%packages\b' 0:type add-highlighter -group /kickstart/packages regex '^\h*%end\b' 0:type -add-highlighter -group /kickstart/shell regex '\`\h*\K%(pre-install|pre|post)\b' 0:type +add-highlighter -group /kickstart/shell regex '\A\h*\K%(pre-install|pre|post)\b' 0:type add-highlighter -group /kickstart/shell regex '^\h*%end\b' 0:type add-highlighter -group /kickstart/shell ref sh diff --git a/rc/extra/modeline.kak b/rc/extra/modeline.kak index 2902eb77..dc14779a 100644 --- a/rc/extra/modeline.kak +++ b/rc/extra/modeline.kak @@ -95,7 +95,7 @@ def -hidden modeline-parse-impl %{ # [text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text] def modeline-parse -docstring "Read and interpret vi-format modelines at the beginning/end of the buffer" %{ try %{ eval -draft %{ - exec \%s\`|.\' %opt{modelines}k %opt{modelines}X \ + exec \%s\A|.\z %opt{modelines}k %opt{modelines}X \ s^\S*?\s+?(vim?|kak(oune)?):\s?[^\n]+ eval -draft -itersel modeline-parse-impl } } diff --git a/rc/extra/moon.kak b/rc/extra/moon.kak index 2f63f60a..08e698af 100644 --- a/rc/extra/moon.kak +++ b/rc/extra/moon.kak @@ -66,11 +66,11 @@ def -hidden moon-filter-around-selections %{ def -hidden moon-indent-on-char %{ eval -draft -itersel %{ # align _else_ statements to start - try %{ exec -draft ^ \h * (else(if)?) $ ^ \h * (if|unless|when) s \A | \Z \' } + try %{ exec -draft ^ \h * (else(if)?) $ ^ \h * (if|unless|when) s \A | \z \' } # align _when_ to _switch_ then indent - try %{ exec -draft ^ \h * (when) $ ^ \h * (switch) s \A | \Z \' \' } + try %{ exec -draft ^ \h * (when) $ ^ \h * (switch) s \A | \z \' \' } # align _catch_ and _finally_ to _try_ - try %{ exec -draft ^ \h * (catch|finally) $ ^ \h * (try) s \A | \Z \' } + try %{ exec -draft ^ \h * (catch|finally) $ ^ \h * (try) s \A | \z \' } } } diff --git a/rc/extra/php.kak b/rc/extra/php.kak index f3242441..c317e473 100644 --- a/rc/extra/php.kak +++ b/rc/extra/php.kak @@ -40,7 +40,7 @@ def -hidden php-filter-around-selections %{ def -hidden php-indent-on-char %< eval -draft -itersel %< # align closer token to its opener when alone on a line - try %/ exec -draft ^\h+[]}]$ m s \`|.\' 1 / + try %/ exec -draft ^\h+[]}]$ m s \A|.\z 1 / > > diff --git a/rc/extra/ragel.kak b/rc/extra/ragel.kak index 416743af..e9a0a868 100644 --- a/rc/extra/ragel.kak +++ b/rc/extra/ragel.kak @@ -37,8 +37,8 @@ def -hidden ragel-filter-around-selections %{ def -hidden ragel-indent-on-char %< eval -draft -itersel %< # align closer token to its opener when alone on a line - try %< exec -draft ^\h+[]})]$ m s \`|.\' 1 > - try %< exec -draft ^\h+ [*]$ [*]$ s \`|.\' 1 > + try %< exec -draft ^\h+[]})]$ m s \A|.\z 1 > + try %< exec -draft ^\h+ [*]$ [*]$ s \A|.\z 1 > > > diff --git a/rc/extra/tupfile.kak b/rc/extra/tupfile.kak index ce8af71d..931cacaf 100644 --- a/rc/extra/tupfile.kak +++ b/rc/extra/tupfile.kak @@ -23,7 +23,7 @@ add-highlighter -group /tupfile/code regex "\$\([\w_]+\)" 0:value add-highlighter -group /tupfile/code regex ":\s*(foreach)\b" 1:keyword add-highlighter -group /tupfile/code regex "\.gitignore\b" 0:keyword add-highlighter -group /tupfile/code regex "\b(ifn?eq|ifn?def|else|endif|error|include|include_rules|run|preload|export)\b" 0:keyword -add-highlighter -group /tupfile/code regex "\b(\&?[\w_]+)\s*[:+]?=" 1:keyword +add-highlighter -group /tupfile/code regex "\b(&?[\w_]+)\s*[:+]?=" 1:keyword # Initialization # ‾‾‾‾‾‾‾‾‾‾‾‾‾‾