Describe the bug
When &t_SR or &t_SI is set, insert and Replace mode work as expected, but in replace, the cursor jumps visually five steps to the right (seems to correspond to the length of the string variable) while the operation is pending. After replacement the cursor returns correctly, but if the character was changed, the new character is visually followed by the string in &t_EI (without the ^[), and the cursor does not change back from the underline mode. This can be reset by triggering a redraw (^L).
I can't tell what changes in how r sends ansi escape codes compared to R, but something causes the two codes to interfere.
To Reproduce
vim --clean:let &t_SR="\e[7 q", :let &t_EI="\e[2 q"abcdefgar, first bug: cursor moves to fb, second bug: text becomes b[2 qfg, cursor is still the replace shape<C-L>, text is bbcdefgExpected behavior
The cursor should stay in the same place, the text should immediately become bbcdefg and the cursor should reset.
Environment (please complete the following information):
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Update, using
let &t_SR="\<CSI>7\ q" and let &t_EI="\<CSI>2\ q" fixes the second bug, but the cursor still jumps (but to e now, I guess because &t_SR is one character shorter)
@gustaphe Were you able to find a fix for the cursor jumping forward? I'm currently dealing with this same issue and haven't been able to find a solution
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
No. In the WT convo linked above I've updated the description a little (new and interesting bugs ...), and there's a comment describing using C to solve it. One day I'll look into that, but I keep forgetting to.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
(Implementation detail)
Win32 version of Vim uses its own terminal codes:
https://github.com/vim/vim/blob/ad6d9cc679259936b7c8453f17c0ec9d7ab7dcd0/src/term.c#L561-L570
and they are translated into actual escape sequences (or into Win32 console API calls):
https://github.com/vim/vim/blob/ad6d9cc679259936b7c8453f17c0ec9d7ab7dcd0/src/os_win32.c#L6454-L6462
Currently, this doesn't support t_SR, t_SI and so on. Maybe we need to pass through these kind of esc sequences.
BTW, I found that this function missing implementation for Windows Terminal:
https://github.com/vim/vim/blob/ad6d9cc679259936b7c8453f17c0ec9d7ab7dcd0/src/os_win32.c#L1523-L1528
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Okay, now there's a plugin at gustaphe/winterm.vim
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
I'm now preparing a patch for this issue:
https://osdn.net/users/k_takata/pf/vim-ktakata-mq/scm/blobs/312c07eac6ba0528dde08cbd240fc7ea10fe3e44/win32-set-cursor-style.patch
The following .vimrc works after applying this patch.
" Change cursor shape if &term =~ 'xterm' || &term == 'win32' " Use DECSCUSR escape sequences let &t_SI = "\e[5 q" " blink bar let &t_SR = "\e[3 q" " blink underline let &t_EI = "\e[1 q" " blink block let &t_ti .= "\e[1 q" " blink block let &t_te .= "\e[0 q" " default (normally blink block) endif
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
Closed #6576 as completed via df5320c.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()