Make `M.chat:focus()` optional · Issue #1464 · CopilotC-Nvim/CopilotChat.nvim · GitHub
Skip to content

Make M.chat:focus() optional #1464

Open

Description

@oleg-work

Hallo,

      {
        "<leader>ae",
        function()
          local copilot = require("CopilotChat")
          copilot.ask("Explain code underneath")
        end,
        desc = "Explain code underneath (CopilotChat)",
        mode = { "n", "v" },
      },

Consider this snippet as example, everything works fine, my last wish is that I don't want to focus copilot-chat window and for cursor to stay where it was before.

I think relevant line is here, but I don't fully understand logic behind checks if we are indeed in copilot-chat window and if I create flag and optionally disable vim.api.nvim_set_current_win(self.winnr) visual selection stops working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions