Skip to content

Add selectInside/selectSurroundingPair commands (with tests)#189

Open
CB2Moon wants to merge 3 commits intoselfint:mainfrom
CB2Moon:feat/pair-selection
Open

Add selectInside/selectSurroundingPair commands (with tests)#189
CB2Moon wants to merge 3 commits intoselfint:mainfrom
CB2Moon:feat/pair-selection

Conversation

@CB2Moon
Copy link
Contributor

@CB2Moon CB2Moon commented Oct 26, 2025

Added select inside brackets (or markup tags) shortcut
Added select surrounding pair brackets
Update tree-sitter version to fix some errors

This commit adds multi-cursor support to selectBlock, updateSelection,
moveSelection, and navigate commands. When multiple cursors or selections
exist, each is processed independently and results are merged intelligently.

Changes:
- selectBlock: Maps over all selections to find blocks at each cursor
- updateSelection: Updates each selection independently (parent/child/next/prev)
- moveSelection: Orders moves to prevent interference, handles single vs multi
- navigate: Collects navigation targets for all cursors
- Add mergeSelections helper to combine overlapping selections
- Add dedupeSelections helper to remove duplicate cursor positions
- Add comprehensive test suite (MultiSelectBlockMode.test.ts)
…de; Update tree-sitter dependency to fix typing and parser loading issues

This commit adds two new commands for working with paired delimiters
(brackets, quotes, parentheses) along with an interactive pair edit mode.

New commands:
- selectInside: Cycle through content/full/outer selections for pairs
- selectSurroundingPair: Enter pair edit mode to rename delimiters
Features:
- Pair edit mode with visual decorations and status bar indicator
- Type opening delimiter to replace both open/close delimiters
- Escape to exit mode, backspace/delete work within mode
- Supports multi-cursor/multi-select for batch operations
- Add utilities/selectionUtils.ts with findContainingPair helper
- Export positionToPoint from FileTree for tree-sitter integration
- Add keybindings: Ctrl+Alt+I (selectInside), Ctrl+Alt+' (pair edit)
- Add context 'codeBlocks.awaitingPairEdit' for conditional keybindings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant