Skip to content

Conversation

@sudo-tee
Copy link
Owner

  • Remove selection clear when changing files
  • Add add_visual_selection and command
  • Add oy mapping to add visual selection to context across buffers

This should fix #248

Previously, selections were cleared when switching files, resulting in a loss of context for the user. This change ensures selection state is maintained across file switches, improving UX continuity.

This should improve #248
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new workflow for accumulating visual selections into Opencode context across buffers/files (addressing #248), and updates defaults/docs to expose the new command/keymap.

Changes:

  • Stop clearing accumulated selections when switching files during context loading.
  • Introduce add_visual_selection (context + API command) and bind it to <leader>oy in visual mode.
  • Document the new action/keymap in the README and add a shared OpencodeSelectionRange type.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lua/opencode/types.lua Adds OpencodeSelectionRange type used for range-based selection APIs.
lua/opencode/context/chat_context.lua Keeps selections when the current file changes (enables accumulation across files).
lua/opencode/context/base_context.lua Extends get_current_selection signature to accept an optional range.
lua/opencode/context.lua Adds context.add_visual_selection() helper to capture and append selections.
lua/opencode/config.lua Adds default <leader>oy mapping for visual-mode selection accumulation.
lua/opencode/api.lua Adds :Opencode add_visual_selection command and API entrypoint.
README.md Documents the new action and keymap.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sudo-tee sudo-tee force-pushed the feat/visual-selection branch 3 times, most recently from 84668dc to d2d320f Compare February 11, 2026 16:30
…s buffers

 - Add add_visual_selection and command

This should fix #248
@sudo-tee sudo-tee force-pushed the feat/visual-selection branch from d2d320f to 630e325 Compare February 11, 2026 16:32
@sudo-tee sudo-tee merged commit 3ef4e8d into main Feb 11, 2026
10 checks passed
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.

<leader>oi cannot accumulate selections across files

1 participant