softwrap: save and restore firstcolumn when internally spell-fixing text

In do_int_spell_fix(), spell-checking text may change firstcolumn if
the next match is offscreen, and spell-checking text after that will
not change it back.  In order to keep the viewport unchanged, we have
to save and restore not just edittop, but firstcolumn as well.
master
David Lawrence Ramsey 2017-01-25 01:25:22 -06:00 committed by Benno Schulenberg
parent 7cd50b8c02
commit c888edf409
1 changed files with 2 additions and 0 deletions

View File

@ -2534,6 +2534,7 @@ void do_full_justify(void)
bool do_int_spell_fix(const char *word)
{
char *save_search, *exp_word;
size_t firstcolumn_save = openfile->firstcolumn;
size_t current_x_save = openfile->current_x;
filestruct *edittop_save = openfile->edittop;
filestruct *current_save = openfile->current;
@ -2655,6 +2656,7 @@ bool do_int_spell_fix(const char *word)
/* Restore the viewport to where it was. */
openfile->edittop = edittop_save;
openfile->firstcolumn = firstcolumn_save;
/* Restore the settings of the global flags. */
memcpy(flags, stash, sizeof(flags));