Open groves opened 2 years ago
Hi, I am unable to recreate on current master with or without curses enabled. You will have to try with an updated Nix package. Given that you can't recreate this yourself on macOS it leads me to think its a bug in NixOS.
When I have a file with lines that wrap multiple times and I edit a new file that doesn't have specific text on those lines, the text from the previous file remains. I've only seen this behavior on NixOS. I only recently started using Vis on NixOS, so it's always been Vis 0.7 using a recent version of Vis in nixpkgs like this one.
The simplest repro I've found is to open a tiny terminal with 13 columns and 23 lines and to open this file in vis:
That wraps like this in vis in that tiny window:
If I then run
:e blank
, where blank is a non-existent file I get this in vis:I've enabled UI_DEBUG in compiling vis and can see that the correct space character is being set in all the blank cells. I've added debug printing to
ui_curses_blit
inui-terminal-curses.c
and have confirmed that the correct space character is being sent to ncurses'mvaddstr
. If I callvis:redraw()
onWIN_OPEN
events in my visrc.lua, the characters from the previous file disappear. If I call ncurses'erase
function inui_curses_blit
, the phantom characters remain.All that together makes me think this is a bug in ncurses' double buffering code, but I'm not sure where to take this from there. I'm running ncurses 6.3 in Nix, but I don't get the same issue with ncurses 6.3 with vis built by homebrew on my Mac.
Any thoughts on next steps I could take to debug this?