pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/57749



The following reply was made to PR pkg/57749; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: dickey%invisible-island.net@localhost
Subject: Re: pkg/57749
Date: Tue, 5 Mar 2024 22:40:15 +0000 (UTC)

 If only the cursor is moved, then a wnoutrefresh() is needed by BSD-curses
 for doupdate() to reflect the new cursor location. Ncurses doesn't seem to
 need that.
 
 Reproducer:
 
 ```
 #ifdef DO_NCURSES
 #include <ncursesw/ncurses.h>
 #else
 #include <curses.h>
 #endif
 
 int main(void) {
  	WINDOW* w;
 
  	initscr();
  	noecho();
  	raw();
 
  	w = newwin(0, 0, 0, 0);
  	mvwaddstr(w, 0, 0, "Hello!");
 
  	wmove(w, 10, 10);
  	doupdate();		/* no wnoutrefresh() needed because text written */
  	(void)wgetch(w);
 
  	wmove(w, 0, 0);		/* only move cursor now */
  	// wnoutrefresh(w);	/* must refresh on BSD-curses, else cursor doesn't move */
  	doupdate();
  	(void)wgetch(w);
 
  	delwin(w);
  	endwin();
 }
 ```
 
 Patch (somebody please upstream):
 
 ```
 diff -urN nano-7.2.orig/src/winio.c nano-7.2/src/winio.c
 --- nano-7.2.orig/src/winio.c	2023-01-18 08:19:15.000000000 +0000
 +++ nano-7.2/src/winio.c	2024-03-05 22:35:39.461926238 +0000
 @@ -2502,8 +2502,10 @@
   		column -= get_page_start(column);
   	}
 
 -	if (row < editwinrows)
 +	if (row < editwinrows) {
   		wmove(midwin, row, margin + column);
 +		wnoutrefresh(midwin);
 +	}
   #ifndef NANO_TINY
   	else
   		statusline(ALERT, "Misplaced cursor -- please report a bug");
 ```
 
 -RVP
 



Home | Main Index | Thread Index | Old Index