Problem
The current <leader>oi behavior has two issues that prevent accumulating selections across files:
- Selections are cleared when switching files - After selecting content in File A, switching to File B clears the previous selection
- Cannot add selections when panel is already open - When the panel is open, selecting content in another file and pressing
<leader>oi has no effect
Reproduction
- Open File A, select some code, press
<leader>oi to add to context
- Switch to File B, select another piece of code
- Press
<leader>oi - expected to add File B's selection to context, but:
- Issue 1: If panel is not open, File A's selection is already cleared
- Issue 2: If panel is already open, nothing happens
Expected Behavior
Allow accumulating selections across files, supporting selection in any buffer and adding to the existing selection set, with selections persisting throughout the session lifecycle.
Proposed Solution
- New API:
context.add_visual_selection() - Only adds the current visual selection without clearing existing selections
- Bug fix: Modify
debounced_load() to append selections instead of replacing them
- New keymap:
<leader>oa (add selection) specifically for adding selections, separating the responsibility from <leader>oi (open input)
This allows <leader>oa to add selections from any buffer at any time without interfering with the normal <leader>oi workflow.
Problem
The current
<leader>oibehavior has two issues that prevent accumulating selections across files:<leader>oihas no effectReproduction
<leader>oito add to context<leader>oi- expected to add File B's selection to context, but:Expected Behavior
Allow accumulating selections across files, supporting selection in any buffer and adding to the existing selection set, with selections persisting throughout the session lifecycle.
Proposed Solution
context.add_visual_selection()- Only adds the current visual selection without clearing existing selectionsdebounced_load()to append selections instead of replacing them<leader>oa(add selection) specifically for adding selections, separating the responsibility from<leader>oi(open input)This allows
<leader>oato add selections from any buffer at any time without interfering with the normal<leader>oiworkflow.