Skip to content

Commit e1d5144

Browse files
committed
Add a menu option to disable a sign group
1 parent 9b5c799 commit e1d5144

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lua/scrollview.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3114,7 +3114,8 @@ local handle_mouse = function(button, is_primary, init_props, init_mousepos)
31143114
if clicked_sign then
31153115
local group = sign_specs[props.sign_spec_id].group
31163116
lhs = menu_name .. '.' .. group
3117-
rhs = '<nop>'
3117+
rhs = '<cmd>let g:scrollview_disable_sign_group = "'
3118+
.. group .. '"<cr>'
31183119
vim.cmd('anoremenu ' .. lhs .. ' ' .. rhs)
31193120
local variant = sign_specs[props.sign_spec_id].variant
31203121
if variant ~= nil then
@@ -3194,6 +3195,16 @@ local handle_mouse = function(button, is_primary, init_props, init_mousepos)
31943195
})
31953196
api.nvim_set_current_win(popup_win)
31963197
vim.cmd('popup ' .. menu_name)
3198+
if vim.g.scrollview_disable_sign_group ~= vim.NIL then
3199+
local group = vim.g.scrollview_disable_sign_group
3200+
vim.g.scrollview_disable_sign_group = vim.NIL
3201+
vim.cmd('silent! aunmenu ' .. menu_name)
3202+
lhs = menu_name .. '.disable'
3203+
rhs = '<cmd>call timer_start('
3204+
.. '0, {-> execute("ScrollViewDisable ' .. group .. '")})<cr>'
3205+
vim.cmd('anoremenu ' .. lhs .. ' ' .. rhs)
3206+
vim.cmd('popup ' .. menu_name)
3207+
end
31973208
vim.cmd('silent! aunmenu ' .. menu_name)
31983209
api.nvim_win_close(popup_win, true)
31993210
refresh_bars()

0 commit comments

Comments
 (0)