Skip to content

Commit

Permalink
fix: Compatibility with Visual Multi plug (#278)
Browse files Browse the repository at this point in the history
fixes #115
  • Loading branch information
JoseConseco authored Sep 3, 2022
1 parent a2749c5 commit 92916b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/which-key/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ M.auto = false
M.count = 0
M.buf = nil
M.win = nil
M.is_visual_multi_mode = nil

function M.is_valid()
return M.buf
Expand All @@ -24,6 +25,7 @@ function M.is_valid()
end

function M.show()
M.is_visual_multi_mod = vim.b.visual_multi
if M.is_valid() then
return
end
Expand Down Expand Up @@ -130,6 +132,10 @@ function M.hide()
vim.api.nvim_win_close(M.win, { force = true })
M.win = nil
end
if M.is_visual_multi_mod then
M.is_visual_multi_mod = false
vim.cmd[[normal \\gS]] -- reselect visual-multi text
end
end

function M.show_cursor()
Expand Down

0 comments on commit 92916b6

Please sign in to comment.