Skip to content

Commit

Permalink
�fix(select): Fix condition for 'visual_mode' selection (#539)
Browse files Browse the repository at this point in the history
* fix(select.lua): Fix condition for 'visual_mode' selection

* fix: Include operation pending mode

* fix: Remove vim.notify

* fix: Remove visual_mode condition
  • Loading branch information
xvzc authored Dec 24, 2023
1 parent 4795812 commit 4de2749
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions lua/nvim-treesitter/textobjects/select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,6 @@ function M.detect_selection_mode(query_string, keymap_mode)
selection_mode = selection_modes or "v"
end

-- According to "mode()" mapping, if we are in operator pending mode or visual mode,
-- then last char is {v,V,<C-v>}, exept for "no", which is "o", in which case we honor
-- last set `selection_mode`
local visual_mode = vim.fn.mode(1)
visual_mode = visual_mode:sub(#visual_mode)
selection_mode = visual_mode == "o" and selection_mode or visual_mode

if selection_mode == "n" then
selection_mode = "v"
end
Expand Down

0 comments on commit 4de2749

Please sign in to comment.