nvim-numbertoggle icon indicating copy to clipboard operation
nvim-numbertoggle copied to clipboard

Plugin redraws screen when leaving nvim focus in tmux marking the window as having new activity

Open erikw opened this issue 2 years ago • 8 comments

Hey,

this is a cool plugin, it's useful! However I've needed to disable it unfortunately as it does not play well with tmux. When switching to another window in tmux, it seems like the window just left where nvim is, that this plugin redraws the screen. This causes tmux to alert that something has changed (new output) in the window that was just left, and also marking it as having new activity in the window list.

See the attached video for a demonstration.

https://user-images.githubusercontent.com/175286/207864906-dea42b75-9b53-4426-82be-7adf2d28563a.mov

The expected behavior, which is the case when this plugin is not used in nvim, is that there is no nvim activity when leaving the window, thus no false activity notifications.

Maybe nvim-numbertoggle redraws the screen all the time?

My system: nvim: 0.8.1 OS: macOS 12.6 nvim-numbertoggle: latest version

erikw avatar Dec 15 '22 12:12 erikw

Maybe nvim-numbertoggle redraws the screen all the time?

You're right, it should only redraw on CmdlineEnter.

sitiom avatar Dec 15 '22 13:12 sitiom

Let me know if that fixes the issue 👍

sitiom avatar Dec 15 '22 13:12 sitiom

@sitiom Hey thanks for looking in to this so quickly!

I updated the plugin to the latest version (main branch) but unfortunately the behavior is the same as in the video above :(

erikw avatar Dec 15 '22 16:12 erikw

That's weird. At this point, it should only redraw on CmdlineEnter. Perhaps it's not something else that is the issue? Can you try using https://github.com/jeffkreeftmeijer/vim-numbertoggle and see if the same issue exists on that plugin?

I don't use tmux, so help would be pretty much appreciated.

sitiom avatar Dec 16 '22 01:12 sitiom

Can you try using https://github.com/jeffkreeftmeijer/vim-numbertoggle and see if the same issue exists on that plugin?

Yes this plugin also have the exact same behaviour as in the original video above :)

I don't use tmux, so help would be pretty much appreciated.

(I recommend it, a true life-safer ;))

erikw avatar Dec 16 '22 06:12 erikw

Can you try using https://github.com/jeffkreeftmeijer/vim-numbertoggle and see if the same issue exists on that plugin?

Yes this plugin also have the exact same behaviour as in the original video above :)

Hmm, then I'm not sure what I can do. It is the plugin's behavior to set the line numbering to absolute when focus is lost, which would do a redraw. I don't know if there's a way to check for this specific use case. You might want to open an issue on the other repo as well and see if they have a bright idea.

sitiom avatar Dec 16 '22 07:12 sitiom

I'm using this plugin with tmux. Both them work well on my side.

My system: nvim: 0.9 OS: macOS tmux: next-3.4

rockyzhang24 avatar May 05 '23 05:05 rockyzhang24

the issue seems to be with redraw and other plugins that manage multiple windows:

https://github.com/sitiom/nvim-numbertoggle/blob/9ab95e60ea5ec138e1b2332e0fc18b8e5de464c6/plugin/numbertoggle.lua#L19

Is redrawing necessary?

kevintraver avatar Oct 18 '23 20:10 kevintraver