]> git.wh0rd.org Git - nano.git/commitdiff
Backport r5384 from trunk.
authorChris Allegretta <chrisa@asty.org>
Sun, 15 Nov 2015 07:02:26 +0000 (07:02 +0000)
committerChris Allegretta <chrisa@asty.org>
Sun, 15 Nov 2015 07:02:26 +0000 (07:02 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_4_branch@5420 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/nano.c

index 29f9a93607bc83a99bd806c3d05c2493b2a728a8..861722e9a91163837f8b212ab4b35e50553c95bf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-31  Benno Schulenberg  <bensberg@justemail.net>
+       * src/nano.c (copy_from_filestruct): When pasting while the mark is
+       on, the mark's pointer needs to be refreshed only when it is on the
+       same line as the cursor, and the mark's x coordinate only when the
+       mark is located after the cursor.  This fixes Savannah bug #46347.
+
 2015-10-29  Benno Schulenberg  <bensberg@justemail.net>
        * src/text.c (add_undo): Only skip adding an undo when the current
        action equals the last action.  This condition is needed for when
index 534ccb31c8e3130ba56c322151a0c75f3169a410..1a16e1da98642f58681c0c30b38bf3e20c555f34 100644 (file)
@@ -458,7 +458,7 @@ void copy_from_filestruct(filestruct *somebuffer)
     openfile->current_x = strlen(openfile->filebot->data);
     if (openfile->fileage == openfile->filebot) {
 #ifndef NANO_TINY
-       if (openfile->mark_set) {
+       if (openfile->mark_set && single_line) {
            openfile->mark_begin = openfile->current;
            if (!right_side_up)
                openfile->mark_begin_x += openfile->current_x;
@@ -476,9 +476,8 @@ void copy_from_filestruct(filestruct *somebuffer)
        } else {
            if (single_line) {
                openfile->mark_begin = openfile->current;
-               openfile->mark_begin_x -= current_x_save;
-           } else
-               openfile->mark_begin_x -= openfile->current_x;
+               openfile->mark_begin_x += openfile->current_x - current_x_save;
+           }
        }
     }
 #endif