diff --git a/src/nano.c b/src/nano.c index b84856e2..a6a54e14 100644 --- a/src/nano.c +++ b/src/nano.c @@ -409,6 +409,7 @@ void ingraft_buffer(filestruct *somebuffer) { filestruct *top_save; size_t current_x_save = openfile->current_x; + const bool bookmarked = openfile->current->bookmarked; bool edittop_inside; #ifndef NANO_TINY bool right_side_up = FALSE, single_line = FALSE; @@ -442,6 +443,9 @@ void ingraft_buffer(filestruct *somebuffer) while (openfile->filebot->next != NULL) openfile->filebot = openfile->filebot->next; + /* Restore bookmark of current line. */ + openfile->fileage->bookmarked = bookmarked; + /* Put the cursor at the end of the pasted text. */ openfile->current = openfile->filebot; openfile->current_x = strlen(openfile->filebot->data); diff --git a/src/text.c b/src/text.c index 7190de5e..e686ec69 100644 --- a/src/text.c +++ b/src/text.c @@ -691,7 +691,9 @@ void redo_cut(undo *u) openfile->mark = fsfromline(u->mark_begin_lineno); openfile->mark_x = (u->xflags == WAS_WHOLE_LINE) ? 0 : u->mark_begin_x; + const bool bookmarked = openfile->current->bookmarked; do_cut_text(FALSE, TRUE, FALSE, u->type == ZAP); + openfile->current->bookmarked = bookmarked; free_filestruct(cutbuffer); cutbuffer = oldcutbuffer;