https://www.midnight-commander.org/ticket/2881 https://bugs.gentoo.org/show_bug.cgi?id=434688 commit 28cd54da5a73e6d722bd0534e3f43baedb398cea Author: Andrew Borodin 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 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;