Vim
Vim copied to clipboard
Improve Pair Matching Logic to Skip Parentheses Inside Strings
What this PR does / why we need it:
This PR updates the logic behind parentheses pair matching. Currently, the logic does not ignore parentheses within quotations (i.e. "" or ''). As a result, this leads to incorrect jump behaviour when users expect to skip parentheses within strings rather than treating them as matching pairs. This also consistent with Vim's actual logic.
Current behaviour (using the % command to jump to the next matching pair):
https://github.com/user-attachments/assets/e8e03c99-c132-401d-868f-3d82ca51942b
Fixed behaviour:
https://github.com/user-attachments/assets/037ff90f-792e-4eb6-8a43-6b4693c97ee7
Vim's actual behaviour:
https://github.com/user-attachments/assets/eaf7c42c-60b3-44b2-ab71-696df71672a2
Which issue(s) this PR fixes Addresses: https://github.com/VSCodeVim/Vim/issues/9344
Special notes for your reviewer: