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
parent
7cd50b8c02
commit
c888edf409
|
@ -2534,6 +2534,7 @@ void do_full_justify(void)
|
||||||
bool do_int_spell_fix(const char *word)
|
bool do_int_spell_fix(const char *word)
|
||||||
{
|
{
|
||||||
char *save_search, *exp_word;
|
char *save_search, *exp_word;
|
||||||
|
size_t firstcolumn_save = openfile->firstcolumn;
|
||||||
size_t current_x_save = openfile->current_x;
|
size_t current_x_save = openfile->current_x;
|
||||||
filestruct *edittop_save = openfile->edittop;
|
filestruct *edittop_save = openfile->edittop;
|
||||||
filestruct *current_save = openfile->current;
|
filestruct *current_save = openfile->current;
|
||||||
|
@ -2655,6 +2656,7 @@ bool do_int_spell_fix(const char *word)
|
||||||
|
|
||||||
/* Restore the viewport to where it was. */
|
/* Restore the viewport to where it was. */
|
||||||
openfile->edittop = edittop_save;
|
openfile->edittop = edittop_save;
|
||||||
|
openfile->firstcolumn = firstcolumn_save;
|
||||||
|
|
||||||
/* Restore the settings of the global flags. */
|
/* Restore the settings of the global flags. */
|
||||||
memcpy(flags, stash, sizeof(flags));
|
memcpy(flags, stash, sizeof(flags));
|
||||||
|
|
Loading…
Reference in New Issue