Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

fix: run highlight callback on same buffer #395

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fmgornick
Copy link

i have the following config set:

config = {
  result = {
    split = {
      stay_in_current_window_after_split = false,
    },
  },
}

but with this, i noticed that whenever i ran a request and my cursor switched buffers to the response, my request was permanently highlighted. It looks like this is because the call to utils.highlight uses bufnr = 0, meaning that the deffered call to vim.api.nvim_buf_clear_namespace will (most likely) run in the response buffer.

so i just changed this to use the exact bufnr so the callback function only runs on the buffer that was initially highlighted.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant