mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-25 22:29:42 +03:00
Putting the cursor back in front of a backwards cut,
where it was when the cut was made. Patch by Mark Majeres, edited by Benno Schulenberg. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4966 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
c5c0d748c2
commit
948b8e9bcf
@ -1,3 +1,7 @@
|
|||||||
|
2014-06-14 Mark Majeres <mark@engine12.com>
|
||||||
|
* src/nano.h, src/text.c (undo_cut, update_undo): When undoing a
|
||||||
|
backwards cut, put the cursor back in front of it, where it was.
|
||||||
|
|
||||||
2014-06-13 Benno Schulenberg <bensberg@justemail.net>
|
2014-06-13 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/nano.c (do_input): Repositioning the cursor with the mouse
|
* src/nano.c (do_input): Repositioning the cursor with the mouse
|
||||||
(result == 0) should break a series of ^Ks.
|
(result == 0) should break a series of ^Ks.
|
||||||
|
@ -574,7 +574,7 @@ enum
|
|||||||
/* Extra bits for the undo function. */
|
/* Extra bits for the undo function. */
|
||||||
#define UNdel_del (1<<0)
|
#define UNdel_del (1<<0)
|
||||||
#define UNdel_backspace (1<<1)
|
#define UNdel_backspace (1<<1)
|
||||||
#define UNsplit_completed (1<<2)
|
#define UNcut_marked_backwards (1<<2)
|
||||||
#define UNcut_cutline (1<<3)
|
#define UNcut_cutline (1<<3)
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
||||||
|
@ -396,7 +396,7 @@ void undo_cut(undo *u)
|
|||||||
free_filestruct(cutbuffer);
|
free_filestruct(cutbuffer);
|
||||||
cutbuffer = NULL;
|
cutbuffer = NULL;
|
||||||
|
|
||||||
if (u->xflags == UNcut_cutline)
|
if (u->xflags == UNcut_cutline || u->xflags == UNcut_marked_backwards)
|
||||||
goto_line_posx(u->mark_begin_lineno, u->mark_begin_x);
|
goto_line_posx(u->mark_begin_lineno, u->mark_begin_x);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1072,6 +1072,7 @@ void update_undo(undo_type action)
|
|||||||
ssize_t line = u->lineno;
|
ssize_t line = u->lineno;
|
||||||
u->lineno = u->mark_begin_lineno;
|
u->lineno = u->mark_begin_lineno;
|
||||||
u->mark_begin_lineno = line;
|
u->mark_begin_lineno = line;
|
||||||
|
u->xflags = UNcut_marked_backwards;
|
||||||
}
|
}
|
||||||
} else if (!ISSET(CUT_TO_END)) {
|
} else if (!ISSET(CUT_TO_END)) {
|
||||||
/* Compute cutbottom for the uncut using our copy. */
|
/* Compute cutbottom for the uncut using our copy. */
|
||||||
|
Loading…
Reference in New Issue
Block a user