Not moving the cursor when copying a backwardly marked region.
This fixes Savannah bug #46980. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5671 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
8a2dd978f8
commit
287f78a26b
|
@ -1,6 +1,8 @@
|
||||||
2016-02-23 Benno Schulenberg <bensberg@justemail.net>
|
2016-02-23 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/prompt.c (do_statusbar_output, do_statusbar_delete):
|
* src/prompt.c (do_statusbar_output, do_statusbar_delete):
|
||||||
Rename a variable, for contrast and correctness.
|
Rename a variable, for contrast and correctness.
|
||||||
|
* src/cut.c (do_copy_text): Don't move the cursor when copying a
|
||||||
|
backwardly marked region. This fixes Savannah bug #46980.
|
||||||
|
|
||||||
2016-02-22 Chris Allegretta <chrisa@asty.org>
|
2016-02-22 Chris Allegretta <chrisa@asty.org>
|
||||||
* Add ability to kill the trailing spaces when justifying
|
* Add ability to kill the trailing spaces when justifying
|
||||||
|
|
12
src/cut.c
12
src/cut.c
|
@ -237,6 +237,11 @@ void do_copy_text(void)
|
||||||
static struct filestruct *next_contiguous_line = NULL;
|
static struct filestruct *next_contiguous_line = NULL;
|
||||||
bool mark_set = openfile->mark_set;
|
bool mark_set = openfile->mark_set;
|
||||||
|
|
||||||
|
/* Remember the current view port and cursor position. */
|
||||||
|
ssize_t is_edittop_lineno = openfile->edittop->lineno;
|
||||||
|
ssize_t is_current_lineno = openfile->current->lineno;
|
||||||
|
size_t is_current_x = openfile->current_x;
|
||||||
|
|
||||||
if (mark_set || openfile->current != next_contiguous_line)
|
if (mark_set || openfile->current != next_contiguous_line)
|
||||||
cutbuffer_reset();
|
cutbuffer_reset();
|
||||||
|
|
||||||
|
@ -244,6 +249,13 @@ void do_copy_text(void)
|
||||||
|
|
||||||
/* If the mark was set, blow away the cutbuffer on the next copy. */
|
/* If the mark was set, blow away the cutbuffer on the next copy. */
|
||||||
next_contiguous_line = (mark_set ? NULL : openfile->current);
|
next_contiguous_line = (mark_set ? NULL : openfile->current);
|
||||||
|
|
||||||
|
if (mark_set) {
|
||||||
|
/* Restore the view port and cursor position. */
|
||||||
|
openfile->edittop = fsfromline(is_edittop_lineno);
|
||||||
|
openfile->current = fsfromline(is_current_lineno);
|
||||||
|
openfile->current_x = is_current_x;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Cut from the current cursor position to the end of the file. */
|
/* Cut from the current cursor position to the end of the file. */
|
||||||
|
|
Loading…
Reference in New Issue