feat: add 'update_on_cursor_moved' option to preview window (#250)
This commit is contained in:
parent
a173b5776c
commit
ea612fe926
3 changed files with 31 additions and 25 deletions
|
|
@ -134,6 +134,8 @@ OPTIONS *oil-option
|
||||||
win_options = {
|
win_options = {
|
||||||
winblend = 0,
|
winblend = 0,
|
||||||
},
|
},
|
||||||
|
-- Whether the preview window is automatically updated when the cursor is moved
|
||||||
|
update_on_cursor_moved = true,
|
||||||
},
|
},
|
||||||
-- Configuration for the floating progress window
|
-- Configuration for the floating progress window
|
||||||
progress = {
|
progress = {
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,8 @@ local default_config = {
|
||||||
win_options = {
|
win_options = {
|
||||||
winblend = 0,
|
winblend = 0,
|
||||||
},
|
},
|
||||||
|
-- Whether the preview window is automatically updated when the cursor is moved
|
||||||
|
update_on_cursor_moved = true,
|
||||||
},
|
},
|
||||||
-- Configuration for the floating progress window
|
-- Configuration for the floating progress window
|
||||||
progress = {
|
progress = {
|
||||||
|
|
|
||||||
|
|
@ -364,6 +364,7 @@ M.initialize = function(bufnr)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if config.preview.update_on_cursor_moved then
|
||||||
-- Debounce and update the preview window
|
-- Debounce and update the preview window
|
||||||
if timer then
|
if timer then
|
||||||
timer:again()
|
timer:again()
|
||||||
|
|
@ -392,6 +393,7 @@ M.initialize = function(bufnr)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue