Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"compact" rendering style has messed up highlight positioning #171

Closed
runiq opened this issue Jan 27, 2023 · 8 comments
Closed

"compact" rendering style has messed up highlight positioning #171

runiq opened this issue Jan 27, 2023 · 8 comments

Comments

@runiq
Copy link

runiq commented Jan 27, 2023

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:

image

Not sure what causes it, though.

@rcarriga
Copy link
Owner

rcarriga commented Feb 14, 2023

I can't reproduce any issue with the highlighting, if you can provide a minimal init.lua then I can look into this further

mikesmithgh added a commit to mikesmithgh/starter that referenced this issue Feb 28, 2023
@mikesmithgh
Copy link

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
Screenshot 2023-02-28 at 10 40 24 AM

Please let me know if you need any additional information

@runiq
Copy link
Author

runiq commented Feb 28, 2023

@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.

@mikesmithgh
Copy link

@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 👍

@mikesmithgh
Copy link

FYI this appears to be an issue in noice.nvim, I opened a draft PR: folke/noice.nvim#375

@folke
Copy link
Contributor

folke commented Mar 2, 2023

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.

@runiq
Copy link
Author

runiq commented Mar 2, 2023

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!

@runiq runiq closed this as completed Mar 2, 2023
@rcarriga
Copy link
Owner

rcarriga commented Mar 3, 2023

Great to see a resolution 😄 Thanks @folke for the info and @mikesmithgh for the reproduction!

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

No branches or pull requests

4 participants