mirror of https://github.com/MidnightCommander/mc
Merge branch '2881_editor_offset_after_tab'
* 2881_editor_offset_after_tab: Ticket #2881: (edit_move_forward3): fix two-columns extra offset of cursor
This commit is contained in:
commit
ad44cd1abb
|
@ -3073,16 +3073,15 @@ edit_move_forward3 (WEdit * edit, off_t current, long cols, off_t upto)
|
||||||
c = convert_to_display_c (c);
|
c = convert_to_display_c (c);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (c == '\n')
|
||||||
|
return (upto != 0 ? (off_t) col : p);
|
||||||
if (c == '\t')
|
if (c == '\t')
|
||||||
col += TAB_SIZE - col % TAB_SIZE;
|
col += TAB_SIZE - col % TAB_SIZE;
|
||||||
else if (c == '\n')
|
else if ((c < 32 || c == 127) && (orig_c == c
|
||||||
return (upto != 0 ? (off_t) col : p);
|
|
||||||
|
|
||||||
if ((c < 32 || c == 127) && (orig_c == c
|
|
||||||
#ifdef HAVE_CHARSET
|
#ifdef HAVE_CHARSET
|
||||||
|| (!mc_global.utf8_display && !edit->utf8)
|
|| (!mc_global.utf8_display && !edit->utf8)
|
||||||
#endif
|
#endif
|
||||||
))
|
))
|
||||||
/* '\r' is shown as ^M, so we must advance 2 characters */
|
/* '\r' is shown as ^M, so we must advance 2 characters */
|
||||||
/* Caret notation for control characters */
|
/* Caret notation for control characters */
|
||||||
col += 2;
|
col += 2;
|
||||||
|
|
Loading…
Reference in New Issue