You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
wsetscrreg( WINDOW *win, int top, int bottom)requires that the cursor be somewhere between top and bottom. I don't see why. I suspect it mattered once upon a time and no longer does. The actual scrolling just scrolls the region between top and bottom (stored in win->_tmarg and win->_bmarg), with no reference to the cursor location. ncurses ignores the cursor location for this function.
On a slightly related matter : wdeleteln() will delete the line under the cursor and move everything from there to the bottom of the scroll region (win->_bmarg) up one line. If the cursor is below the bottom margin of the scroll region, wdeleteln() erases the current line and does nothing else.
winsertln() will insert a blank line at the cursor position and push everything down to the bottom of the window (win->_maxy - 1). I think wdeleteln() is the one in error here (ncurses also seems to think that the deletion/insertion should go right down to the bottom of the window). Basically, the scrolling functions should always look at _bmarg and _tmarg and never at the cursor location. winsertln()/wdeleteln() should always look at the current cursor y value and the bottom of the window, and never at _bmarg or _tmarg. (Well, winsertln() already does this; only wdeleteln() requires tweaking. Fortunately, not much of it.)
wsetscrreg( WINDOW *win, int top, int bottom)
requires that the cursor be somewhere betweentop
andbottom
. I don't see why. I suspect it mattered once upon a time and no longer does. The actual scrolling just scrolls the region betweentop
andbottom
(stored inwin->_tmarg
andwin->_bmarg
), with no reference to the cursor location. ncurses ignores the cursor location for this function.On a slightly related matter :
wdeleteln()
will delete the line under the cursor and move everything from there to the bottom of the scroll region (win->_bmarg
) up one line. If the cursor is below the bottom margin of the scroll region,wdeleteln()
erases the current line and does nothing else.winsertln()
will insert a blank line at the cursor position and push everything down to the bottom of the window (win->_maxy - 1
). I thinkwdeleteln()
is the one in error here (ncurses also seems to think that the deletion/insertion should go right down to the bottom of the window). Basically, the scrolling functions should always look at_bmarg
and_tmarg
and never at the cursor location.winsertln()/wdeleteln()
should always look at the current cursor y value and the bottom of the window, and never at_bmarg
or_tmarg
. (Well,winsertln()
already does this; onlywdeleteln()
requires tweaking. Fortunately, not much of it.)I have written a small test program to exercise these functions that may be useful.
The text was updated successfully, but these errors were encountered: