Commit e96022b9 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

After an undo or redo, update the 'placewewant'.

Patch by Mark Majeres.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4976 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 6 additions and 1 deletion
+6 -1
2014-06-17 Mark Majeres <mark@engine12.com>
* src/text.c (do_undo, do_redo): After an undo or redo, update the
'placewewant' (the desired horizontal position of the cursor).
2014-06-17 Benno Schulenberg <bensberg@justemail.net> 2014-06-17 Benno Schulenberg <bensberg@justemail.net>
* src/text.c (do_undo, do_redo): Remove obsolete boolean variable. * src/text.c (do_undo, do_redo): Remove obsolete boolean variable.
......
...@@ -558,6 +558,7 @@ void do_undo(void) ...@@ -558,6 +558,7 @@ void do_undo(void)
renumber(f); renumber(f);
openfile->current_undo = openfile->current_undo->next; openfile->current_undo = openfile->current_undo->next;
openfile->last_action = OTHER; openfile->last_action = OTHER;
openfile->placewewant = xplustabs();
set_modified(); set_modified();
} }
...@@ -611,7 +612,6 @@ void do_redo(void) ...@@ -611,7 +612,6 @@ void do_redo(void)
free(f->data); free(f->data);
f->data = data; f->data = data;
openfile->current_x = u->begin; openfile->current_x = u->begin;
openfile->placewewant = xplustabs();
goto_line_posx(u->lineno, u->begin); goto_line_posx(u->lineno, u->begin);
break; break;
case ENTER: case ENTER:
...@@ -674,6 +674,7 @@ void do_redo(void) ...@@ -674,6 +674,7 @@ void do_redo(void)
openfile->current_undo = u; openfile->current_undo = u;
openfile->last_action = OTHER; openfile->last_action = OTHER;
openfile->placewewant = xplustabs();
set_modified(); set_modified();
} }
#endif /* !NANO_TINY */ #endif /* !NANO_TINY */
......
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