screen: use the correct width to determine whether a softwrap occurred
This fixes the two bugs reported by Anton Minaev in https://savannah.gnu.org/bugs/?49511.master
parent
a4132e2e64
commit
7598b77e75
|
@ -1936,10 +1936,10 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
ensure_line_is_visible();
|
ensure_line_is_visible();
|
||||||
|
|
||||||
/* Well, we might also need a full refresh if we've changed the
|
/* If the number of screen rows that a softwrapped line occupies
|
||||||
* line length to be a new multiple of COLS. */
|
* has changed, we need a full refresh. */
|
||||||
if (ISSET(SOFTWRAP) && refresh_needed == FALSE)
|
if (ISSET(SOFTWRAP) && refresh_needed == FALSE)
|
||||||
if (strlenpt(openfile->current->data) / COLS != orig_lenpt / COLS)
|
if (strlenpt(openfile->current->data) / editwincols != orig_lenpt / editwincols)
|
||||||
refresh_needed = TRUE;
|
refresh_needed = TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -173,8 +173,10 @@ void do_deletion(undo_type action)
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
ensure_line_is_visible();
|
ensure_line_is_visible();
|
||||||
|
|
||||||
|
/* If the number of screen rows that a softwrapped line occupies
|
||||||
|
* has changed, we need a full refresh. */
|
||||||
if (ISSET(SOFTWRAP) && refresh_needed == FALSE)
|
if (ISSET(SOFTWRAP) && refresh_needed == FALSE)
|
||||||
if (strlenpt(openfile->current->data) / COLS != orig_lenpt / COLS)
|
if (strlenpt(openfile->current->data) / editwincols != orig_lenpt / editwincols)
|
||||||
refresh_needed = TRUE;
|
refresh_needed = TRUE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue