Skip to content

Commit d75d959

Browse files
authored
Merge pull request #440 from jakelinnzy/master
Fix 'No matching autocommands' warning caused by #437
2 parents 41bbb8c + 2cee2ad commit d75d959

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

autoload/EasyMotion.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,9 @@ function! s:PromptUser(groups) "{{{
10951095
let lines_items = items(lines)
10961096
" }}}
10971097

1098+
" Invoke autocmd so the user can temporarily disable linters, etc.
1099+
silent doautocmd User EasyMotionPromptBegin
1100+
10981101
" -- Put labels on targets & Get User Input & Restore all {{{
10991102
" Save undo tree
11001103
let undo_lock = EasyMotion#undo#save()
@@ -1148,6 +1151,9 @@ function! s:PromptUser(groups) "{{{
11481151
call undo_lock.restore()
11491152

11501153
redraw
1154+
1155+
" Invoke autocmd
1156+
silent doautocmd User EasyMotionPromptEnd
11511157
endtry "}}}
11521158

11531159
" -- Check if we have an input char ------ {{{

doc/easymotion.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*easymotion.txt* Version 3.0
1+
*easymotion.txt* Version 3.0
22

33

44
______ __ ___ __ _
@@ -38,6 +38,7 @@ CONTENTS *easymotion-contents*
3838
Custom mappings ................. |easymotion-custom-mappings|
3939
Leader key .................. |easymotion-leader-key|
4040
Custom keys ................. |easymotion-custom-keys|
41+
Autocommands .................... |easymotion-autocommands|
4142
License ............................ |easymotion-license|
4243
Known bugs ......................... |easymotion-known-bugs|
4344
Contributing ....................... |easymotion-contributing|
@@ -1139,6 +1140,28 @@ Example: >
11391140
See |easymotion-plug-table| for a table of motions that can be mapped
11401141
and their default values.
11411142

1143+
------------------------------------------------------------------------------
1144+
Autocommands *easymotion-autocommands*
1145+
*EasyMotionPromptBegin* *EasyMotionPromptEnd*
1146+
1147+
EasyMotion invokes two |User| autocommands, |EasyMotionPromptBegin| and
1148+
|EasyMotionPromptEnd|, so you can temporarily disable your linter to avoid
1149+
annoying syntax errors.
1150+
1151+
EasyMotionPromptBegin Before the content of buffer is changed with
1152+
markers. If EasyMotion directly jumps to the
1153+
target (no prompts given), this autocommand will
1154+
not be executed.
1155+
1156+
EasyMotionPromptEnd After the content of buffer and the undo tree are
1157+
restored.
1158+
1159+
Example with coc.nvim: >
1160+
1161+
autocmd User EasyMotionPromptBegin silent! CocDisable
1162+
autocmd User EasyMotionPromptEnd silent! CocEnable
1163+
<
1164+
11421165
==============================================================================
11431166
License *easymotion-license*
11441167

0 commit comments

Comments
 (0)