mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-10 11:32:11 +03:00
anchor: do not let piping and spelling transfer an anchor to the top
Just let all anchors disappear when doing an external spell check or
formatting or piping the buffer through an external command, because
leaving just a single anchor on the top line is useless.
This fixes https://savannah.gnu.org/bugs/?58273.
Bug existed since commit 732cf887
from one month ago. That code
causes an anchor to persist at the point where lines are removed.
This commit is contained in:
parent
11f099e1da
commit
4bdd6013b0
@ -1057,6 +1057,7 @@ bool execute_command(const char *command)
|
||||
}
|
||||
add_undo(CUT, NULL);
|
||||
do_snip(openfile->mark != NULL, openfile->mark == NULL, FALSE);
|
||||
openfile->filetop->has_anchor = FALSE;
|
||||
update_undo(CUT);
|
||||
}
|
||||
|
||||
|
@ -2446,8 +2446,10 @@ const char *treat(char *tempfile_name, char *theprogram, bool spelling)
|
||||
openfile->current_x = strlen(openfile->current->data);
|
||||
|
||||
#ifndef NANO_TINY
|
||||
if (replaced)
|
||||
if (replaced) {
|
||||
openfile->filetop->has_anchor = FALSE;
|
||||
update_undo(COUPLE_END);
|
||||
}
|
||||
#endif
|
||||
|
||||
openfile->placewewant = pww_save;
|
||||
|
Loading…
Reference in New Issue
Block a user