mirror of
https://github.com/zoriya/virtcolumn.nvim.git
synced 2026-06-05 01:49:15 +00:00
fix: Add more events to trigger the refresh (fix #7)
This commit is contained in:
@@ -120,7 +120,7 @@ local function refresh(args)
|
|||||||
winscrolled_timer:stop()
|
winscrolled_timer:stop()
|
||||||
winscrolled_timer:close()
|
winscrolled_timer:close()
|
||||||
end
|
end
|
||||||
winscrolled_timer = vim.defer_fn(_refresh, 50)
|
winscrolled_timer = vim.defer_fn(_refresh, 20)
|
||||||
elseif event:match('TextChanged') then
|
elseif event:match('TextChanged') then
|
||||||
if textchanged_timer and textchanged_timer:is_active() then
|
if textchanged_timer and textchanged_timer:is_active() then
|
||||||
textchanged_timer:stop()
|
textchanged_timer:stop()
|
||||||
@@ -132,7 +132,7 @@ local function refresh(args)
|
|||||||
vim.b.virtcolumn_lines_count = lines_count
|
vim.b.virtcolumn_lines_count = lines_count
|
||||||
delay = 10
|
delay = 10
|
||||||
else
|
else
|
||||||
delay = 50
|
delay = 20
|
||||||
end
|
end
|
||||||
textchanged_timer = vim.defer_fn(_refresh, delay)
|
textchanged_timer = vim.defer_fn(_refresh, delay)
|
||||||
else
|
else
|
||||||
@@ -156,6 +156,8 @@ api.nvim_create_autocmd({
|
|||||||
'TextChanged',
|
'TextChanged',
|
||||||
'TextChangedI',
|
'TextChangedI',
|
||||||
'WinEnter',
|
'WinEnter',
|
||||||
|
'BufWinEnter',
|
||||||
|
'BufRead',
|
||||||
'InsertLeave',
|
'InsertLeave',
|
||||||
'InsertEnter',
|
'InsertEnter',
|
||||||
'FileChangedShellPost',
|
'FileChangedShellPost',
|
||||||
|
|||||||
Reference in New Issue
Block a user