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.
i have the following config set:
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
usesbufnr = 0
, meaning that the deffered call tovim.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.