Skip to content

Commit

Permalink
Replace ModeChange hooks by ModePush and ModePop
Browse files Browse the repository at this point in the history
Remove deprecated InsertBegin, InsertEnd, NormalBegin, NormalEnd
hooks.

Closes #2545
  • Loading branch information
mawww committed Oct 16, 2019
1 parent 3a36a24 commit e4fb70e
Show file tree
Hide file tree
Showing 47 changed files with 58 additions and 85 deletions.
4 changes: 4 additions & 0 deletions doc/pages/changelog.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ released versions.

* Arrow keys and `<home>`, `<end>` are not normal mode commands
anymore but default key mappings.

* `ModeChange` hook parameter now takes `push:` or `pop:` prefix,
`InsertBegin`, `InsertEnd`, `NormalBegin` and `NormalEnd`
were removed.

== Kakoune 2019.07.01

Expand Down
16 changes: 2 additions & 14 deletions doc/pages/hooks.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,12 @@ name. Hooks with no description will always use an empty string.
*NormalIdle*::
a certain duration has passed since the last keypress in normal mode

*NormalBegin*::
entering normal mode

*NormalEnd*::
leaving normal mode

*NormalKey* `key`::
a key is received in normal mode

*InsertIdle*::
a certain duration has passed since the last keypress in insert mode

*InsertBegin*::
entering insert mode

*InsertEnd*::
leaving insert mode

*InsertKey* `key`::
a key is received in insert mode

Expand Down Expand Up @@ -150,8 +138,8 @@ name. Hooks with no description will always use an empty string.
*RuntimeError* `error message`::
an error was encountered while executing a user command

*ModeChange* `<old mode>:<new mode>`::
Triggered whenever the current input mode changes
*ModeChange* `[push|pop]:<old mode>:<new mode>`::
Triggered whenever a mode is pushed or removed from the mode stack.

*KakBegin* `session name`::
kakoune has started, this hook is called just after reading the user
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/awk.kak
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ hook global WinSetOption filetype=awk %{
require-module awk

hook window InsertChar \n -group awk-indent awk-indent-on-new-line
hook window ModeChange insert:.* -group awk-trim-indent awk-trim-indent
hook window ModeChange pop:insert:.* -group awk-trim-indent awk-trim-indent

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window awk-.+ }
}
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/c-family.kak
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ hook global WinSetOption filetype=(c|cpp|objc) %[

evaluate-commands "set-option window static_words %%opt{%val{hook_param_capture_1}_static_words}"

hook -group "%val{hook_param_capture_1}-trim-indent" window ModeChange insert:.* c-family-trim-indent
hook -group "%val{hook_param_capture_1}-trim-indent" window ModeChange pop:insert:.* c-family-trim-indent
hook -group "%val{hook_param_capture_1}-insert" window InsertChar \n c-family-insert-on-newline
hook -group "%val{hook_param_capture_1}-indent" window InsertChar \n c-family-indent-on-newline
hook -group "%val{hook_param_capture_1}-indent" window InsertChar \{ c-family-indent-on-opening-curly-brace
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/cabal.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](cabal) %{
hook global WinSetOption filetype=cabal %[
require-module cabal

hook window ModeChange insert:.* -group cabal-trim-indent cabal-trim-indent
hook window ModeChange pop:insert:.* -group cabal-trim-indent cabal-trim-indent
hook window InsertChar \n -group cabal-indent cabal-indent-on-new-line
hook window InsertChar \{ -group cabal-indent cabal-indent-on-opening-curly-brace
hook window InsertChar \} -group cabal-indent cabal-indent-on-closing-curly-brace
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/clojure.kak
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ EOF
define-command -hidden clojure-configure-window %{
set-option window static_words %opt{clojure_static_words}

hook window ModeChange insert:.* -group clojure-trim-indent clojure-trim-indent
hook window ModeChange pop:insert:.* -group clojure-trim-indent clojure-trim-indent
hook window InsertChar \n -group clojure-indent clojure-indent-on-new-line

set-option buffer extra_word_chars '_' . / * ? + - < > ! : "'"
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/coffee.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](coffee) %{
hook global WinSetOption filetype=coffee %{
require-module coffee

hook window ModeChange insert:.* -group coffee-trim-indent coffee-trim-indent
hook window ModeChange pop:insert:.* -group coffee-trim-indent coffee-trim-indent
hook window InsertChar \n -group coffee-indent coffee-indent-on-new-line

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window coffee-.+ }
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/css.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](css) %{
hook global WinSetOption filetype=css %[
require-module css

hook window ModeChange insert:.* -group css-trim-indent css-trim-indent
hook window ModeChange pop:insert:.* -group css-trim-indent css-trim-indent
hook window InsertChar \n -group css-indent css-indent-on-new-line
hook window InsertChar \} -group css-indent css-indent-on-closing-curly-brace
set-option buffer extra_word_chars '_' '-'
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/cucumber.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](feature|story) %{
hook global WinSetOption filetype=cucumber %{
require-module cucumber

hook window ModeChange insert:.* -group cucumber-trim-indent cucumber-trim-indent
hook window ModeChange pop:insert:.* -group cucumber-trim-indent cucumber-trim-indent
hook window InsertChar \n -group cucumber-indent cucumber-indent-on-new-line

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window cucumber-.+ }
Expand Down
4 changes: 2 additions & 2 deletions rc/filetype/d.kak
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hook global WinSetOption filetype=d %{
set-option window static_words %opt{d_static_words}

# cleanup trailing whitespaces when exiting insert mode
hook window ModeChange insert:.* -group d-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window ModeChange pop:insert:.* -group d-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window InsertChar \n -group d-indent d-indent-on-new-line
hook window InsertChar \{ -group d-indent d-indent-on-opening-curly-brace
hook window InsertChar \} -group d-indent d-indent-on-closing-curly-brace
Expand Down Expand Up @@ -77,7 +77,7 @@ evaluate-commands %sh{
types="${types}|string|ubyte|ucent|uint|ulong|ushort|void|wchar|wstring"
values="true|false|null"
tokens="__FILE__|__MODULE__|__LINE__|__FUNCTION__"
tokens="${tokens}|__PRETTY_FUNCTION__|__DATE__|__EOF__|__TIME__"
tokens="${tokens}|__Change|pop:__DATE__|__EOF__|__TIME__"

This comment has been minimized.

Copy link
@Delapouite

Delapouite Oct 17, 2019

Contributor

Looks like this line was replaced inadvertently

This comment has been minimized.

Copy link
@mawww

mawww Oct 17, 2019

Author Owner

Ouch, yeah it was.

tokens="${tokens}|__TIMESTAMP__|__VENDOR__|__VERSION__|#line"
properties="this|init|sizeof|alignof|mangleof|stringof|infinity|nan|dig|epsilon|mant_dig"
properties="${properties}|max_10_exp|min_exp|max|min_normal|re|im|classinfo"
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/dart.kak
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hook global WinSetOption filetype=dart %{
set-option window static_words %opt{dart_static_words}

# cleanup trailing whitespaces when exiting insert mode
hook window ModeChange insert:.* -group dart-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window ModeChange pop:insert:.* -group dart-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window InsertChar \n -group dart-indent dart-indent-on-new-line
hook window InsertChar \{ -group dart-indent dart-indent-on-opening-curly-brace
hook window InsertChar \} -group dart-indent dart-indent-on-closing-curly-brace
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/elixir.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](ex|exs) %{
hook global WinSetOption filetype=elixir %{
require-module elixir

hook window ModeChange insert:.* -group elixir-trim-indent elixir-trim-indent
hook window ModeChange pop:insert:.* -group elixir-trim-indent elixir-trim-indent
hook window InsertChar \n -group elixir-indent elixir-indent-on-new-line

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window elixir-.+ }
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/elm.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](elm) %{
hook global WinSetOption filetype=elm %{
require-module elm

hook window ModeChange insert:.* -group elm-trim-indent elm-trim-indent
hook window ModeChange pop:insert:.* -group elm-trim-indent elm-trim-indent
hook window InsertChar \n -group elm-indent elm-indent-on-new-line

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window elm-.+ }
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/go.kak
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hook global WinSetOption filetype=go %{
set-option window static_words %opt{go_static_words}

# cleanup trailing whitespaces when exiting insert mode
hook window ModeChange insert:.* -group go-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window ModeChange pop:insert:.* -group go-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window InsertChar \n -group go-indent go-indent-on-new-line
hook window InsertChar \{ -group go-indent go-indent-on-opening-curly-brace
hook window InsertChar \} -group go-indent go-indent-on-closing-curly-brace
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/haml.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](haml) %{
hook global WinSetOption filetype=haml %{
require-module haml

hook window ModeChange insert:.* -group haml-trim-indent haml-trim-indent
hook window ModeChange pop:insert:.* -group haml-trim-indent haml-trim-indent
hook window InsertChar \n -group haml-indent haml-indent-on-new-line

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window haml-.+ }
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/haskell.kak
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ hook global WinSetOption filetype=haskell %{
require-module haskell

set-option buffer extra_word_chars '_' "'"
hook window ModeChange insert:.* -group haskell-trim-indent haskell-trim-indent
hook window ModeChange pop:insert:.* -group haskell-trim-indent haskell-trim-indent
hook window InsertChar \n -group haskell-indent haskell-indent-on-new-line

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window haskell-.+ }
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/hbs.kak
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hook global BufCreate .*[.](hbs) %{
hook global WinSetOption filetype=hbs %{
require-module hbs

hook window ModeChange insert:.* -group hbs-trim-indent hbs-trim-indent
hook window ModeChange pop:insert:.* -group hbs-trim-indent hbs-trim-indent
hook window InsertChar \n -group hbs-indent hbs-indent-on-new-line
hook window InsertChar .* -group hbs-indent hbs-indent-on-char
hook window InsertChar '>' -group hbs-indent html-indent-on-greater-than
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/html.kak
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hook global BufCreate .*\.xml %{
hook global WinSetOption filetype=(html|xml) %{
require-module html

hook window ModeChange insert:.* -group "%val{hook_param_capture_1}-trim-indent" html-trim-indent
hook window ModeChange pop:insert:.* -group "%val{hook_param_capture_1}-trim-indent" html-trim-indent
hook window InsertChar '>' -group "%val{hook_param_capture_1}-indent" html-indent-on-greater-than
hook window InsertChar \n -group "%val{hook_param_capture_1}-indent" html-indent-on-new-line

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/i3.kak
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ hook global WinSetOption filetype=i3 %[
require-module i3

# cleanup trailing whitespaces when exiting insert mode
hook window ModeChange insert:.* -group i3-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window ModeChange pop:insert:.* -group i3-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window InsertChar \n -group i3-indent i3-indent-on-new-line
hook window InsertChar \} -group i3-indent i3-indent-on-closing-curly-brace

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/java.kak
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ hook global WinSetOption filetype=java %{
require-module java

# cleanup trailing whitespaces when exiting insert mode
hook window ModeChange insert:.* -group java-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window ModeChange pop:insert:.* -group java-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window InsertChar \n -group java-indent java-indent-on-new-line
hook window InsertChar \{ -group java-indent java-indent-on-opening-curly-brace
hook window InsertChar \} -group java-indent java-indent-on-closing-curly-brace
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/javascript.kak
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ hook global BufCreate .*[.](ts)x? %{
hook global WinSetOption filetype=(javascript|typescript) %{
require-module javascript

hook window ModeChange insert:.* -group "%val{hook_param_capture_1}-trim-indent" javascript-trim-indent
hook window ModeChange pop:insert:.* -group "%val{hook_param_capture_1}-trim-indent" javascript-trim-indent
hook window InsertChar .* -group "%val{hook_param_capture_1}-indent" javascript-indent-on-char
hook window InsertChar \n -group "%val{hook_param_capture_1}-indent" javascript-indent-on-new-line

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/json.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](json) %{
hook global WinSetOption filetype=json %{
require-module json

hook window ModeChange insert:.* -group json-trim-indent json-trim-indent
hook window ModeChange pop:insert:.* -group json-trim-indent json-trim-indent
hook window InsertChar .* -group json-indent json-indent-on-char
hook window InsertChar \n -group json-indent json-indent-on-new-line

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/kakrc.kak
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ hook global WinSetOption filetype=kak %~
hook window InsertChar [>)}\]] -group kak-indent kak-indent-on-closing-matching
hook window InsertChar (?![[{(<>)}\]])[^\s\w] -group kak-indent kak-indent-on-closing-char
# cleanup trailing whitespaces on current line insert end
hook window ModeChange insert:.* -group kak-trim-indent %{ try %{ execute-keys -draft \; <a-x> s ^\h+$ <ret> d } }
hook window ModeChange pop:insert:.* -group kak-trim-indent %{ try %{ execute-keys -draft \; <a-x> s ^\h+$ <ret> d } }
set-option buffer extra_word_chars '_' '-'

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window kak-.+ }
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/latex.kak
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ hook global WinSetOption filetype=latex %(

hook window InsertChar \n -group latex-indent %{ latex-indent-newline }
hook window InsertChar \} -group latex-indent %{ latex-indent-closing-brace }
hook window ModeChange insert:.* -group latex-indent %{ latex-trim-indent }
hook window ModeChange pop:insert:.* -group latex-indent %{ latex-trim-indent }
hook -once -always window WinSetOption filetype=.* %{ remove-hooks latex-indent }
)

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/ledger.kak
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hook global WinSetOption filetype=ledger %{
require-module ledger

hook window InsertChar \n -group ledger-indent ledger-indent-on-new-line
hook window ModeChange insert:.* -group ledger-trim-indent ledger-trim-indent
hook window ModeChange pop:insert:.* -group ledger-trim-indent ledger-trim-indent

hook -once -always window WinSetOption filetype=.* %{
remove-hooks window ledger-.+
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/lisp.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](lisp) %{
hook global WinSetOption filetype=lisp %{
require-module lisp

hook window ModeChange insert:.* -group lisp-trim-indent lisp-trim-indent
hook window ModeChange pop:insert:.* -group lisp-trim-indent lisp-trim-indent
hook window InsertChar \n -group lisp-indent lisp-indent-on-new-line
set-option buffer extra_word_chars '_' '+' '-' '*' '/' '@' '$' '%' '^' '&' '_' '=' '<' '>' '~' '.'

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/moon.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](moon) %{
hook global WinSetOption filetype=moon %{
require-module moon

hook window ModeChange insert:.* -group moon-trim-indent moon-trim-indent
hook window ModeChange pop:insert:.* -group moon-trim-indent moon-trim-indent
hook window InsertChar .* -group moon-indent moon-indent-on-char
hook window InsertChar \n -group moon-indent moon-indent-on-new-line

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/nim.kak
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hook global WinSetOption filetype=nim %{

hook window InsertChar \n -group nim-indent nim-indent-on-new-line
# cleanup trailing whitespaces on current line insert end
hook window ModeChange insert:.* -group nim-trim-indent %{ try %{ exec -draft \; <a-x> s ^\h+$ <ret> d } }
hook window ModeChange pop:insert:.* -group nim-trim-indent %{ try %{ exec -draft \; <a-x> s ^\h+$ <ret> d } }

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window nim-.+ }
}
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/nix.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](nix) %{
hook global WinSetOption filetype=nix %{
require-module nix

hook window ModeChange insert:.* -group nix-trim-indent nix-trim-indent
hook window ModeChange pop:insert:.* -group nix-trim-indent nix-trim-indent
hook window InsertChar .* -group nix-indent nix-indent-on-char
hook window InsertChar \n -group nix-indent nix-indent-on-new-line

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/perl.kak
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hook global WinSetOption filetype=perl %{
set-option window static_words %opt{perl_static_words}

# cleanup trailing whitespaces when exiting insert mode
hook window ModeChange insert:.* -group perl-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window ModeChange pop:insert:.* -group perl-trim-indent %{ try %{ execute-keys -draft <a-x>s^\h+$<ret>d } }
hook window InsertChar \n -group perl-indent perl-indent-on-new-line
hook window InsertChar \{ -group perl-indent perl-indent-on-opening-curly-brace
hook window InsertChar \} -group perl-indent perl-indent-on-closing-curly-brace
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/php.kak
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ hook global BufCreate .*[.](php) %{
hook global WinSetOption filetype=php %{
require-module php

hook window ModeChange insert:.* -group php-trim-indent php-trim-indent
hook window ModeChange pop:insert:.* -group php-trim-indent php-trim-indent
hook window InsertChar .* -group php-indent php-indent-on-char
hook window InsertChar \n -group php-indent php-indent-on-new-line

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/pony.kak
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hook global WinSetOption filetype=pony %{

hook window InsertChar \n -group pony-indent pony-indent-on-new-line
# cleanup trailing whitespaces on current line insert end
hook window ModeChange insert:.* -group pony-trim-indent %{ try %{ execute-keys -draft \; <a-x> s ^\h+$ <ret> d } }
hook window ModeChange pop:insert:.* -group pony-trim-indent %{ try %{ execute-keys -draft \; <a-x> s ^\h+$ <ret> d } }

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window pony-.+ }
}
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/pug.kak
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hook global BufCreate .*[.](pug|jade) %{
hook global WinSetOption filetype=pug %{
require-module pug

hook window ModeChange insert:.* -group pug-trim-indent pug-trim-indent
hook window ModeChange pop:insert:.* -group pug-trim-indent pug-trim-indent
hook window InsertChar \n -group pug-indent pug-indent-on-new-line

hook -once -always window WinSetOption filetype=.* %{ remove-hooks window pug-.+ }
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/python.kak
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hook global WinSetOption filetype=python %{

hook window InsertChar \n -group python-indent python-indent-on-new-line
# cleanup trailing whitespaces on current line insert end
hook window ModeChange insert:.* -group python-trim-indent %{ try %{ execute-keys -draft \; <a-x> s ^\h+$ <ret> d } }
hook window ModeChange pop:insert:.* -group python-trim-indent %{ try %{ execute-keys -draft \; <a-x> s ^\h+$ <ret> d } }
hook -once -always window WinSetOption filetype=.* %{ remove-hooks window python-.+ }
}

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/r.kak
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ hook -group r-highlight global WinSetOption filetype=r %{
}

hook global WinSetOption filetype=r %~
hook window ModeChange insert:.* r-trim-indent
hook window ModeChange pop:insert:.* r-trim-indent
hook window InsertChar \n r-insert-on-newline
hook window InsertChar \n r-indent-on-newline
hook window InsertChar \{ r-indent-on-opening-curly-brace
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/ragel.kak
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ hook global BufCreate .*[.](ragel|rl) %{
hook global WinSetOption filetype=ragel %{
require-module ragel

hook window ModeChange insert:.* -group ragel-trim-indent ragel-trim-indent
hook window ModeChange pop:insert:.* -group ragel-trim-indent ragel-trim-indent
hook window InsertChar .* -group ragel-indent ragel-indent-on-char
hook window InsertChar \n -group ragel-indent ragel-indent-on-new-line

Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/rust.kak
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hook global BufCreate .*[.](rust|rs) %{

hook global WinSetOption filetype=rust %[
require-module rust
hook window InsertEnd .* -group rust-trim-indent rust-trim-indent
hook window ModeChange pop:insert:.* -group rust-trim-indent rust-trim-indent
hook window InsertChar \n -group rust-indent rust-indent-on-new-line
hook window InsertChar \{ -group rust-indent rust-indent-on-opening-curly-brace
hook window InsertChar [)}] -group rust-indent rust-indent-on-closing
Expand Down
2 changes: 1 addition & 1 deletion rc/filetype/sass.kak
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ hook global BufCreate .*[.](sass) %{
hook global WinSetOption filetype=sass %{
require-module sass

hook window ModeChange insert:.* -group sass-trim-indent sass-trim-indent
hook window ModeChange pop:insert:.* -group sass-trim-indent sass-trim-indent
hook window InsertChar \n -group sass-indent sass-indent-on-new-line
set-option buffer extra_word_chars '_' '-'

Expand Down
Loading

0 comments on commit e4fb70e

Please sign in to comment.