Closed gegoune closed 2 years ago
Ah, sorry, pressed submit by mistake. Minimal config is not working, nvim-notify is erroring with Error running notification service: ...e/pack/packer/start/nvim-notify/lua/notify/util/init.lua:48: attempt to perform arithmetic on a nil value
on
lua vim.notify("This is an error message", "error")
Trying to figure it out right now (@rcarriga, perhaps you know what the issue here is?)
I'm going to guess it's because your Normal
highlight group doesn't have a foreground guifg
colour
@rcarriga Thank you! There was another blend
problem after that which lead me to suspect colorscheme was messing it all up. Have updated my original post's minimal config (added tokyonight) and the bug is reproducible now.
Yep just tried myself and it was the use of colour names rather than hex values. Will be adding support, thanks for accidentally catching that :smile:
Just to weigh in here, I can't seem to reproduce. I'm going to guess this is because of terminal differences (I'm using kitty).
Based on this message https://github.com/TimUntersberger/neogit/issues/158#issuecomment-882837062 it seems like the problem is rapid redrawing, which nvim-notify does (a lot) in order to perform animations. I can see in the NeoGit code there are a number of "refreshes". My first guess would be these are the problem but since I can't reproduce I can't actually test that out
@gegoune can you try doing something like the following
autocmd User NeogitStatusRefresh echom refreshed
Just tried, very interesting. Does not seem to be adding those messages to :messages
.
@gegoune you can reproduce this by using the minimal config and also installing nvim-notify right?
@TimUntersberger Correct, yes, minimal config provided reproduces the issue for me every time.
It might be the case that you need to have blinking cursor enabled in terminal emulator to see it. Did not try to set it to non blinking though.
@gegoune I tried to reproduce this, but I sadly can't. Could you record a small video of the blinking cursor?
@TimUntersberger Please see it on this video, I have used minimal config from top post.
@gegoune can you show me your alacritty config? I sadly can't reproduce this even with the same terminal.
@TimUntersberger
import:
- ~/.local/share/nvim/site/pack/packer/start/tokyonight.nvim/extras/alacritty_tokyonight_night.yml
env:
TERM: alacritty
window:
decorations: full
startup_mode: Fullscreen
scrolling:
history: 0
font:
normal:
family: Iosevka Nerd Font Mono
style: Light
bold:
family: Iosevka Nerd Font Mono
style: Medium
italic:
family: Iosevka Nerd Font Mono
style: Light Italic
bold_italic:
family: Iosevka Nerd Font Mono
style: Medium Italic
size: 14.0
offset:
x: 0
y: 2
use_thin_strokes: true
selection:
semantic_escape_chars: " ,`'\"|()[]{}<>\t="
save_to_clipboard: true
cursor:
style:
blinking: Always
blink_interval: 350
unfocused_hollow: true
shell:
program: /usr/local/bin/tmux
args:
- new-session
- -A
- -D
- -s
- main
alt_send_esc: true
mouse:
hide_when_typing: true
key_bindings:
# Doubt keys are relevant
I tried to reproduce this with your config, but sadly can't.
There are only two differences left:
Can you try to see if the problem is still there if you aren't inside tmux?
Aha! It does not happen without tmux, would have never thought about it! @rcarriga Any chance you can retry with tmux?
This issue might be relevant: https://github.com/neovim/neovim/issues/2528
Although it looks very correct, @TimUntersberger, I think there is more at play here. When I simply do
lua vim.notify("This is an error message", "error")
I don't get that flickering at all.
Here is interesting observation. I have disabled cursor blinking in Alacritty altogether but when notification is displayed it still blinks same as on the video.
I have noticed that it happens after commit but not after push. It also doesn't happen when Packer displays its message. Does that help to narrow down the cause?
I have just noticed something that potentially could be of help. My cursor is blinking like crazy only when there is more than one notification displayed at one time. It's static as expected (I don't havre blinking cursor in my terminal) with only one notification popup shown. @rcarriga Is this helpful somehow?
There's no reason that I can think of as to why it'd happen with more than one notification other than it just being more CPU intensive. It'd be interesting to see if you notice a CPU core being pinned near 100% when you have several notifications
I can see spike in both (bigger spike) wezterm's and neovim's process. Former spikes from around 2% to >60% while cursor is blinking, latter from 0% (idle) to about 10%. I am on 6-core Mac and frankly am not sure if those numbers correspond to single core or entire cpu.
Hmm it doesn't sound like your CPU is getting hammered too much. Could you try my suggestion here: https://github.com/rcarriga/nvim-notify/issues/63#issuecomment-1050635189 and reduce the FPS of rendering to see if it effects the flickering
Tried to set it to various numbers but didn't notice any difference in flickering. This is what it looks like (with 1000 in mentioned pcall):
OK as this looks like it has nothing to do with neogit I'll move discussion over to https://github.com/rcarriga/nvim-notify/issues/63 to avoid polluting another repo :sweat_smile:
I was thinking just that while replying to other issue.
@TimUntersberger Apologies for the noise, it seems like it has nothing to do with your amazing plugin (thanks so much!) apart of the fact that it sends two notifications at one which seem to be somehow causing that behaviour. I really appreciate your patience with me going on with this issue here.
Description
Exactly the same as in #158 - after committing this time and if
rcarriga/nvim-notify
is enabled.After commit is completed and notification displayed cursor is blinking very fast for the entire duration of when notification is displayed.
Neovim version
v0.6.0-dev+96614f84a
Operating system and version
macOS 11.5
Steps to reproduce
mkdir /tmp/test; cd /tmp/test/; git init; echo test > testfile; git add testfile
nvim --clean -u <minimal file from below>
:Neogit commit
Expected behavior
Notification pops up and cursor blink as configured in terminal emulator (Alacritty) rate.
Actual behavior
Cursor blinks very fast (like in #158) for the duration of when notification is displayed. Returns to normal after notification closes.
Minimal config