Skip to content

<leader>oi cannot accumulate selections across files #248

@jensenojs

Description

@jensenojs

Problem

The current <leader>oi behavior has two issues that prevent accumulating selections across files:

  1. Selections are cleared when switching files - After selecting content in File A, switching to File B clears the previous selection
  2. 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

  1. Open File A, select some code, press <leader>oi to add to context
  2. Switch to File B, select another piece of code
  3. 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

  1. New API: context.add_visual_selection() - Only adds the current visual selection without clearing existing selections
  2. Bug fix: Modify debounced_load() to append selections instead of replacing them
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions