if (hasAnyFolding(wp))
set_topline(wp, wp->w_topline);
#endif
- // Relative numbering may require updating more.
+ // If lines have been added or removed, relative numbering always
+ // requires a redraw.
if (wp->w_p_rnu && xtra != 0)
- redraw_win_later(wp, SOME_VALID);
+ {
+ wp->w_last_cursor_lnum_rnu = 0;
+ redraw_win_later(wp, VALID);
+ }
#ifdef FEAT_SYN_HL
// Cursor line highlighting probably need to be updated with
// "VALID" if it's below the change.
conceal_check_cursor_line(cursor_line_was_concealed);
#endif
- // Need to recompute the cursor position, it might move when the cursor
- // is on a TAB or special character.
- // ptr2cells() treats a TAB character as double-width.
- if (ptr2cells(ml_get_cursor()) > 1)
- {
- curwin->w_valid &= ~VALID_VIRTCOL;
- curs_columns(TRUE);
- }
+ // need to position cursor again when on a TAB
+ if (gchar_cursor() == TAB)
+ curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL);
/*
* Enable langmap or IME, indicated by 'iminsert'.
replace_push(c);
break;
}
+
+ buf[0] = c;
+ for (i = 1; i < n; ++i)
+ buf[i] = replace_pop();
+ if (utf_iscomposing(utf_ptr2char(buf)))
+ ins_bytes_len(buf, n);
else
{
- buf[0] = c;
- for (i = 1; i < n; ++i)
- buf[i] = replace_pop();
- if (utf_iscomposing(utf_ptr2char(buf)))
- ins_bytes_len(buf, n);
- else
- {
- // Not a composing char, put it back.
- for (i = n - 1; i >= 0; --i)
- replace_push(buf[i]);
- break;
- }
+ // Not a composing char, put it back.
+ for (i = n - 1; i >= 0; --i)
+ replace_push(buf[i]);
+ break;
}
+
}
}
State = NORMAL;
trigger_modechanged();
- // need to position cursor again (e.g. when on a TAB )
- changed_cline_bef_curs();
+ // need to position cursor again when on a TAB
+ if (gchar_cursor() == TAB)
+ curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL);
setmouse();
#ifdef CURSOR_SHAPE
call TermWait(buf)
call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_2', {})
+ call term_sendkeys(buf, "\<C-O>")
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_3', {})
+
+ call term_sendkeys(buf, 'i')
+ call TermWait(buf)
+ call VerifyScreenDump(buf, 'Test_cursorcolumn_insert_on_tab_2', {})
+
call StopVimInTerminal(buf)
call delete('Xcuc_insert_on_tab')
endfunc