File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
local M = {}
2
- local config = require (" stopinsert.config" )
3
2
4
3
--- Create a simple popup message, positioned in the bottom right corner of the buffer
5
- --- Automatically close this popup after 5 seconds
4
+ --- Automatically close this popup after timeout_ms milliseconds
6
5
--- Courtersy of encourage.nvim
7
6
--- @param message string
7
+ --- @param timeout_ms number
8
8
--- @return nil
9
- function M .show (message )
9
+ function M .show (message , timeout_ms )
10
10
local width = # message
11
11
local height = 1
12
12
local buf = vim .api .nvim_create_buf (false , true )
@@ -34,7 +34,7 @@ function M.show(message)
34
34
if vim .api .nvim_win_is_valid (win ) then
35
35
vim .api .nvim_win_close (win , true )
36
36
end
37
- end , config . clear_popup_ms )
37
+ end , timeout_ms )
38
38
end
39
39
40
40
return M
Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ function M.force_exit_insert_mode()
9
9
vim .cmd (" stopinsert" )
10
10
11
11
if config .show_popup_msg then
12
- popup .show (" StopInsertPlug: You were idling in Insert mode. Remeber to <Esc> when you finish editing." )
12
+ local msg = " StopInsertPlug: You were idling in Insert mode. Remeber to <Esc> when you finish editing."
13
+ popup .show (msg , config .clear_popup_ms )
13
14
end
14
15
end
15
16
end
You can’t perform that action at this time.
0 commit comments