indicator: recompute the extra rows also for cut/paste/split/join

This fixes https://savannah.gnu.org/bugs/?58511.

Bug existed since commit 9a9f36fc from yesterday.
master
Benno Schulenberg 2020-06-07 11:00:49 +02:00
parent 9a9f36fca7
commit 786d2221e1
2 changed files with 21 additions and 0 deletions

View File

@ -94,6 +94,10 @@ void do_deletion(undo_type action)
unlink_node(joining);
#ifndef NANO_TINY
if (ISSET(SOFTWRAP))
openfile->current->extrarows = extra_chunks_in(openfile->current);
#endif
/* Two lines were joined, so do a renumbering and refresh the screen. */
renumber_from(openfile->current);
refresh_needed = TRUE;
@ -322,6 +326,9 @@ void extract_segment(linestruct *top, size_t top_x, linestruct *bot, size_t bot_
#ifndef NANO_TINY
openfile->current->has_anchor = was_anchored;
if (ISSET(SOFTWRAP))
openfile->current->extrarows = extra_chunks_in(openfile->current);
if (post_marked || same_line)
openfile->mark = openfile->current;
if (post_marked)
@ -406,6 +413,11 @@ void ingraft_buffer(linestruct *topline)
openfile->mark_x += length - xpos;
} else if (mark_follows)
openfile->mark_x += extralen;
if (ISSET(SOFTWRAP)) {
line->extrarows = extra_chunks_in(line);
openfile->current->extrarows = extra_chunks_in(openfile->current);
}
#endif
delete_node(topline);

View File

@ -572,6 +572,8 @@ void do_undo(void)
break;
}
line->data[u->tail_x] = '\0';
if (ISSET(SOFTWRAP))
line->extrarows = extra_chunks_in(line);
intruder = make_new_node(line);
intruder->data = copy_of(u->strdata);
splice_node(line, intruder);
@ -720,6 +722,8 @@ void do_redo(void)
case ENTER:
redidmsg = _("line break");
line->data[u->head_x] = '\0';
if (ISSET(SOFTWRAP))
line->extrarows = extra_chunks_in(line);
intruder = make_new_node(line);
intruder->data = copy_of(u->strdata);
splice_node(line, intruder);
@ -898,6 +902,11 @@ void do_enter(void)
openfile->mark = newnode;
openfile->mark_x += extra - openfile->current_x;
}
if (ISSET(SOFTWRAP)) {
openfile->current->extrarows = extra_chunks_in(openfile->current);
newnode->extrarows = extra_chunks_in(newnode);
}
#endif
/* Insert the newly created line after the current one and renumber. */