vim-matchup
vim-matchup copied to clipboard
Cannot correctly jump backward with matchup-Z%
Hi, First, let me thank you for this plugin ! 😸
Explain the issue
Using the following keybinding in my config :
vim.keymap.set('n', '<C-p>', '<plug>(matchup-Z%)')
I noticed that the backward-jump gets blocked when encountering such pattern : ((
// cursor gets blocked on the second parenthesis after array.map : array.map((
const array = [1, 2, 3];
const newArray = array.map((n) => n+1);
console.log(newArray); // place cursor here, and start jumping backward with matchup-Z%
If I would simply add a space just after the .map(
,
like this .map( (n) =>
, cursor would not be blocked anymore :
const array = [1, 2, 3];
const newArray = array.map( (n) => n+1); // ok now
console.log(newArray); // place cursor here, and start jumping backward with matchup-Z%
Of course, we got the same problem with e.g
const array = [[]] // cursor gets blocked on the second [
Versions
This problem occurs with any nvim
version, with classic matching OR treesitter
integration.
This problem occurs with matchup-Z%
( backward jump ) but never with matchup-z%
( forward jump ).