Skip to content

Make M.chat:focus() optional #1464

@oleg-work

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions