Commit c888edf4 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey Committed by Benno Schulenberg
Browse files

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.
No related merge requests found
Showing with 2 additions and 0 deletions
+2 -0
......@@ -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));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment