mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-10 05:22:31 +08:00
Use ModeChanged events instead of InsertLeave emulation #4919 #4738
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-06-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
Some checks are pending
CI / build_image (push) Waiting to run
CI / test_ale (--linters-only) (push) Blocked by required conditions
CI / test_ale (--neovim-06-only) (push) Blocked by required conditions
CI / test_ale (--neovim-08-only) (push) Blocked by required conditions
CI / test_ale (--vim-80-only) (push) Blocked by required conditions
CI / test_ale (--vim-90-only) (push) Blocked by required conditions
`ModeChanged` looks like a more reliable way to detect an "exit insert mode" event and is a lot simpler (doesn't need a timer). Also, it can detect some other transitions like `\<C-o\>` in insert mode. The `ModeChanged` event is available in: * [Vim 8.2.3430](f1e8876fa2) * [NeoVim 0.7.0](69bd1e4e36) --------- Co-authored-by: Dmitry Zolotukhin <zlogic@gmail.com>
This commit is contained in:
@@ -158,9 +158,9 @@ Execute(The message at the cursor should be shown when linting ends):
|
||||
|
||||
AssertEqual 'semi: Missing semicolon.', g:last_message
|
||||
|
||||
Execute(The message at the cursor should be shown on InsertLeave):
|
||||
Execute(The message at the cursor should be shown when leaving insert mode):
|
||||
call cursor(2, 9)
|
||||
doautocmd InsertLeave
|
||||
call feedkeys("i\<Esc>", 'tnix')
|
||||
|
||||
AssertEqual 'space-infix-ops: Infix operators must be spaced.', g:last_message
|
||||
|
||||
|
||||
Reference in New Issue
Block a user