You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-misc/mc/files/mc-4.8.5-Ticket-2881-fix-ta...

40 lines
1.4 KiB

https://www.midnight-commander.org/ticket/2881
https://bugs.gentoo.org/show_bug.cgi?id=434688
commit 28cd54da5a73e6d722bd0534e3f43baedb398cea
Author: Andrew Borodin <aborodin@vmail.ru>
Date: Tue Sep 11 10:14:48 2012 +0400
Ticket #2881: (edit_move_forward3): fix two-columns extra offset of cursor
...after tab character.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
diff --git a/src/editor/edit.c b/src/editor/edit.c
index bfda1b9..3dfd22e 100644
--- a/src/editor/edit.c
+++ b/src/editor/edit.c
@@ -3073,16 +3073,15 @@ edit_move_forward3 (WEdit * edit, off_t current, long cols, off_t upto)
c = convert_to_display_c (c);
#endif
+ if (c == '\n')
+ return (upto != 0 ? (off_t) col : p);
if (c == '\t')
col += TAB_SIZE - col % TAB_SIZE;
- else if (c == '\n')
- return (upto != 0 ? (off_t) col : p);
-
- if ((c < 32 || c == 127) && (orig_c == c
+ else if ((c < 32 || c == 127) && (orig_c == c
#ifdef HAVE_CHARSET
- || (!mc_global.utf8_display && !edit->utf8)
+ || (!mc_global.utf8_display && !edit->utf8)
#endif
- ))
+ ))
/* '\r' is shown as ^M, so we must advance 2 characters */
/* Caret notation for control characters */
col += 2;