Closed runiq closed 1 year ago
I can't reproduce any issue with the highlighting, if you can provide a minimal init.lua
then I can look into this further
I also have this issue. I'm on nvim nightly NVIM v0.9.0-dev-1079+g3f381f4d0-dirty
in Kitty on OSX
I forked the lazy starter repo to reproduce the issue. https://github.com/mikesmithgh/starter/blob/nvim-notify-compact-issue-171/lua/plugins/nvim-notify.lua
You can execute the command:
docker run -w /root -it --rm alpine:edge sh -uelic '
apk add git lazygit neovim ripgrep alpine-sdk --update
git clone https://github.com/mikesmithgh/starter ~/.config/nvim
cd ~/.config/nvim
git checkout nvim-notify-compact-issue-171
nvim
'
Then search for text that doesn't exist /asdf
Please let me know if you need any additional information
@rcarriga Sorry, I've been getting sidetracked left and right. :( Can't provide a repro right now, I'll try tomorrow.
I'm also (kind of) using lazyvim, which uses noice.nvim with nvim-notify as a backend. I suspect the problem is somewhere in that chain, but if you can't reproduce, it's apparently not in nvim-notify.
@rcarriga Sorry, I've been getting sidetracked left and right. :( Can't provide a repro right now, I'll try tomorrow.
I'm also (kind of) using lazyvim, which uses noice.nvim with nvim-notify as a backend. I suspect the problem is somewhere in that chain, but if you can't reproduce, it's apparently not in nvim-notify.
Hey @runiq I was able to add the steps to reproduce that sound like very similar setup 👍
FYI this appears to be an issue in noice.nvim, I opened a draft PR: https://github.com/folke/noice.nvim/pull/375
This has been fixed in the meantime in Noice. See here
Some additional context:
Noice overrides the nvim-notify renderer so we can also add highlights to the messages themselves. Things coming in though nvim_echo
for example have styling for the message body, so noice makes sure those styles also get applied correctly when displayed in nvim-notify.
The compact
renderer is pretty new and different from the other ones in that it prefixes the first line of the body with the title. Noice didn't take col offsets into account. This has now been fixed.
Hey, thanks all for putting in the work, and sorry I couldn't be of more help. I'll try to do better next time!
Great to see a resolution :smile: Thanks @folke for the info and @mikesmithgh for the reproduction!
When I display the output of
:highlight
commands with the"compact"
render style, the positions of the highlights seem to be off by a lot:Not sure what causes it, though.