diff options
| author | Olivier Perret <Olivier.Perret@mailbox.org> | 2018-12-19 10:10:26 +0100 |
|---|---|---|
| committer | Olivier Perret <Olivier.Perret@mailbox.org> | 2018-12-19 10:20:11 +0100 |
| commit | f085e43bf9c9d1fc7da4cd3f1c1b03ac2419d30e (patch) | |
| tree | b0634546f113661e537aaf335e3e3d88298765f3 /rc/base/javascript.kak | |
| parent | d8466f0f39c63eb92dce9c3ad15bc11cc06efa3a (diff) | |
Unify auto-indent trimming hooks
* ModeChange hooks that remove indent now belong to *-trim-indent groups, instead of just -indent
* *-filter-around-selections hooks and commands have been renamed to trim-indent for clarity
Diffstat (limited to 'rc/base/javascript.kak')
| -rw-r--r-- | rc/base/javascript.kak | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/rc/base/javascript.kak b/rc/base/javascript.kak index 25eef44f..861958fb 100644 --- a/rc/base/javascript.kak +++ b/rc/base/javascript.kak @@ -12,7 +12,7 @@ hook global BufCreate .*[.](ts)x? %{ # Commands # ‾‾‾‾‾‾‾‾ -define-command -hidden javascript-filter-around-selections %{ +define-command -hidden javascript-trim-indent %{ # remove trailing white spaces try %{ execute-keys -draft -itersel <a-x> s \h+$ <ret> d } } @@ -31,7 +31,7 @@ define-command -hidden javascript-indent-on-new-line %< # preserve previous line indent try %{ execute-keys -draft \; K <a-&> } # filter previous line - try %{ execute-keys -draft k : javascript-filter-around-selections <ret> } + try %{ execute-keys -draft k : javascript-trim-indent <ret> } # indent after lines beginning / ending with opener token try %_ execute-keys -draft k <a-x> <a-k> ^\h*[[{]|[[{]$ <ret> j <a-gt> _ > @@ -99,7 +99,7 @@ define-command -hidden init-javascript-filetype -params 1 %~ " hook global WinSetOption "filetype=%arg{1}" " - hook window ModeChange insert:.* -group %arg{1}-hooks javascript-filter-around-selections + hook window ModeChange insert:.* -group %arg{1}-trim-indent javascript-trim-indent hook window InsertChar .* -group %arg{1}-indent javascript-indent-on-char hook window InsertChar \n -group %arg{1}-indent javascript-indent-on-new-line |
