Skip to content

bug: send this does not send the proper selection if init and final C are the same #184

@S1M0N38

Description

@S1M0N38

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 26

Describe the bug

When trying to send a visual selection (not a visual line selection) to the AI CLI agent, if the initial column and the final column are the same, the send selection is wrong (missing the end of the selection).

Recording.at.2025-11-05.14.32.11.mp4

Steps To Reproduce

  1. open AI CLI agent.
  2. select some text with visual selection ensuring that the initial and final column are the same.
  3. send the selection to the AI CLI agent.

Expected Behavior

In the screencast, I'm expecting that first selection to be

@README.md :L4:C13-L11:C13

but I'm getting

@README.md :L4:C13

(the second selection in the screencast is just used to show that if initial column and final column are different, the send cmd behaves as expected)

Repro

vim.g.mapleader = " "

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 = {},
      keys = {
        {
          "<leader>aa",
          function()
            require("sidekick.cli").toggle()
          end,
          desc = "Sidekick Toggle CLI",
        },
        {
          "<leader>at",
          function()
            require("sidekick.cli").send({ msg = "{this}" })
          end,
          mode = { "x", "n" },
          desc = "Send This",
        },
      },
    },
  },
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleThis issue or PR has been inactive for a whilewontfixThis issue will not be fixed or implemented

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions