fix(defaults): visual-mode [[,]] for :terminal shell prompts #33203

Problem:
:terminal shell prompt jump mappings ]]/[[ don't work in visual mode.

Solution:
Also define them for in visual mode.

(cherry picked from commit cb247e06f0)

Co-authored-by: msaher <77233589+msaher@users.noreply.github.com>
This commit is contained in:
neovim-backports[bot]
2025-03-30 13:17:46 -07:00
committed by GitHub
parent 89e0ea1788
commit 7e884b78bf

View File

@ -622,10 +622,10 @@ do
end
vim.wo[0][0].winhighlight = winhl .. 'StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC'
vim.keymap.set('n', '[[', function()
vim.keymap.set({ 'n', 'x' }, '[[', function()
jump_to_prompt(nvim_terminal_prompt_ns, 0, args.buf, -vim.v.count1)
end, { buffer = args.buf, desc = 'Jump [count] shell prompts backward' })
vim.keymap.set('n', ']]', function()
vim.keymap.set({ 'n', 'x' }, ']]', function()
jump_to_prompt(nvim_terminal_prompt_ns, 0, args.buf, vim.v.count1)
end, { buffer = args.buf, desc = 'Jump [count] shell prompts forward' })
end,