Skip to content

bug: malformed line numbers when sending {this} to opencode #110

@bennylb

Description

@bennylb

Did you check docs and existing issues?

  • I have read all the sidekick.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of sidekick.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.11.4

Operating system/version

MacOS 15.6.1 (24G90)

Describe the bug

Making a visual selection and sending {this} with <leader>at, or <leader>ap and selecting a prompt that contains {this}, line numbers inserted to opencode's input field are malformed.

I think the line number portion :L21-L22 is missing 3 characters so appears like 1-L22.

It also appears an additional space character is being inserted before the line portion, including other cli agents (claude code, codex etc), to form @file :L21-L22.

Steps To Reproduce

  1. Make a visual selection in a buffer
  2. Send {this} with <leader>at or prompt with <leader>ap
  3. See malformed line numbers in opencode's input field

Expected Behavior

@file:L<N>-L<M> inserted to the input field of opencode.

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/sidekick.nvim", opts = {} },
    -- add any other plugins here
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions