File tree Expand file tree Collapse file tree 1 file changed +8
-18
lines changed
Expand file tree Collapse file tree 1 file changed +8
-18
lines changed Original file line number Diff line number Diff line change @@ -26,21 +26,6 @@ local function mark_set_keymap(key, m)
2626 end
2727end
2828
29- --- Run callback when command is run
30- --- @param cmd string
31- --- @param augroup string | integer
32- --- @param f function ()
33- local on_cmd = function (cmd , augroup , f )
34- api .nvim_create_autocmd (" CmdlineLeave" , {
35- group = augroup ,
36- callback = function ()
37- if fn .getcmdtype () == " :" and vim .startswith (fn .getcmdline (), cmd ) then
38- f ()
39- end
40- end ,
41- })
42- end
43-
4429--- @param key string
4530return function (key )
4631 for code = string.byte (" A" ), string.byte (" Z" ) do
@@ -53,8 +38,13 @@ return function(key)
5338
5439 local group = api .nvim_create_augroup (" NeominimapMark" , {})
5540 for _ , cmd in ipairs ({ " k" , " mar" , " delm" }) do
56- on_cmd (cmd , group , function ()
57- exec_autocmd ({ cmd = cmd })
58- end )
41+ api .nvim_create_autocmd (" CmdlineLeave" , {
42+ group = group ,
43+ callback = function ()
44+ if fn .getcmdtype () == " :" and vim .startswith (fn .getcmdline (), cmd ) then
45+ exec_autocmd ({ cmd = cmd })
46+ end
47+ end ,
48+ })
5949 end
6050end
You can’t perform that action at this time.
0 commit comments