Deleting next to last Directory entry corrupts the list
Cross-platform BBS (ANSI) Terminal
Brought to you by:
deuce
You probably need more than a screen full of directory entries to reproduce this issue.
Go to the next to last item in the list and delete it. Afterwards, the lightbar disappears.
I actually noticed this issue in SCFG and traced it down to this code in uifc32.c ulist() that you wrote:
if(i+(height-vbrdrsize-1)>=opts) {
(*bar)=(height-vbrdrsize);
This actually sets (*bar) out of the range of the current list box.
Since I can reproduce the same/similar behavior in SyncTERM, I figured I'd assign it to you here. :-P
Anonymous
If you arrow down while in this state, the cells below the list window are "hightlighted".
Looks like that's a literal transcription of this code... not sure you can blame me for this one. :D
But that code isn't modifying bar.
Heck, I still don't even know what cur and bar are.
bar is the lightbar offset from the top of the visible list of options (0 being the first visible option). If there are 18 lines (for options) in the list window, the bar should always be between 0 and the list height (the scrollable region of the window) - 1 (e.g. 17 in this example).
cur is the currently selected "option" index (0 being the first option), cur should always between 0 and the option_count - 1.
Last edit: Rob Swindell 2024-11-14
Interesting, looks like it only happens with WIN_XTR...
A simple script for playing with this issue:
Are you close to a solution or I should be working on it too?
Should be fixed in git now.