firenvim icon indicating copy to clipboard operation
firenvim copied to clipboard

Cursor offset from actual text when wrapping text in small boxes

Open BlueDrink9 opened this issue 3 years ago • 4 comments

  • OS Version: Arch, Manjaro and Windows all seem to have it.
  • Browser Version: Brave multiple versions.
  • Browser Addon Version: 2.1.12
  • Neovim Plugin Version: 2.1.12

What I tried to do

Entering text in a small textbox such that the text wraps to the next line.

What happened

The cursor is offset multiple characters (usually the same as the number column width, but not always) ahead of the actual text. For example if ^ represents where the nxet letter will be entered, and | represents the text caret/cursor:

123 text sta^ |

However, sometimes it falls behind the text, sometimes it is many characters ahead of the text.

Troubleshooting

This goes away if I turn off the number column while typing, and returns if I re-enable it (when enabling it, the text shifts with the column but the cursor does not.

I can reproduce it on txti.es by entering a long line in a regular txties window that wraps, then quickly resizing the window so that vim ends up with less than 28 columns.

I haven't yet worked up the energy to reproduce it without my vimrc. I wondered if it was from setting signcolumn=auto:9, but disabling that doesn't fix it.

BlueDrink9 avatar Jan 11 '22 23:01 BlueDrink9

Interesting, I can reproduce this issue, thanks for the detailed report :)

It seems like there's a direct correlation between the number of hidden lines and the number of spaces added before the cursor. I wouldn't be surprised is this could be reproduced in the TUI somehow.

glacambre avatar Jan 12 '22 15:01 glacambre

Glad to know it isn't just me! I've been silently tolerating it for ages.

TUI would surprise me, I've never seen anything like it. Although the autoresize events don't happen in the same way during insert mode

BlueDrink9 avatar Jan 12 '22 19:01 BlueDrink9

Can confirm that this is a neovim issue present in the TUI, I've opened https://github.com/neovim/neovim/issues/17224 . Might take care of it during the week-end it doesn't look too awful to fix :)

glacambre avatar Jan 28 '22 17:01 glacambre

Very nice repro!

BlueDrink9 avatar Jan 30 '22 02:01 BlueDrink9