You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
<leader>oi cannot accumulate selections across files #248
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.
Activity
sudo-tee commentedon Feb 7, 2026
Great suggestion.
The selection was coupled to the current file in the past. Now it is not anymore, it will be a good opportunity to revise the way it works.
fix(context): preserve selections when switching files in chat context
feat: add <leader>oy mapping to add visual selection to context acros…
feat: add <leader>oy mapping to add visual selection to context acros…
sudo-tee commentedon Feb 11, 2026
@jensenojs
I created a MR that would solve both of your concerns
#261
The shortcut to add selection is
<leader>oyor the commandOpencode add_visual_selectionLet me know it it works for you
feat: add <leader>oy mapping to add visual selection to context acros…
feat: add <leader>oy mapping to add visual selection to context acros…
feat: add <leader>oy mapping to add visual selection to context acros…
feat: add <leader>oy mapping to add visual selection to context acros…
fix(context): preserve selections when switching files in chat context
feat: add <leader>oy mapping to add visual selection to context acros…