vim / vim-win32-installer

Vim Win32 Installer
2.22k stars 243 forks source link

Text selection disappears or expands as you scroll the contents of the vim window with the mouse #310

Closed m4c closed 1 year ago

m4c commented 1 year ago

Steps to reproduce

  1. paste a few hundred lines of text
  2. somewhere in its middle part, mark a couple of lines
  3. use the scroll key on your mouse to scroll up or down the text
  4. you will notice that the text selection expands as you move the text up or down

Expected behaviour

The text selection should scroll along with the text without changing.

Version of Vim

9.0.1599

Environment

Windows 10 (10.0.19041.2965), gvim_9.0.1599_x64.exe

chrisbra commented 1 year ago

I cannot reproduce. Please test using gvim --clean. Also, please mention exactly the commands you used. BTW: are you using a real mouse or are you scrolling using e.g. a touchpad?

m4c commented 1 year ago

With the --clean parameter gvim and the scrolling selection effect behaves the same way. I do not use any additional commands, and I use a traditional mouse, without any additional drivers. The situation repeats on three different machines (same system and Vim versions). v9.0.1607 have the same bug.

chrisbra commented 1 year ago

so, what about the exact commands you used please?

chrisbra commented 1 year ago

also, are you talking about gui vim or terminal? I suppose you use gvim?

m4c commented 1 year ago

As I wrote above - I use gvim (gui vim), without any additional commands.

chrisbra commented 1 year ago

I mean what commands do you use e.g. for "mark a couple of commands"?

chrisbra commented 1 year ago

please be precise

m4c commented 1 year ago

I'm precise. I wrote "mark a couple of lines" of text (not commands!) that has been pasted. (e.g. README after installation ;)

chrisbra commented 1 year ago

So by mark, you mean, "click with the mouse" and Vim will change into "visual" mode? is that true? And by scrolling you are not just only scrolling a few lines, but moving the beginning/end of the selection out of the window?

I believe, in that case, this is expected behaviour, as you cannot move the cursor out of a window and so the selection will extend.

m4c commented 1 year ago

So by mark, you mean, "click with the mouse" and Vim will change into "visual" mode? is that true? And by scrolling you are not just only scrolling a few lines, but moving the beginning/end of the selection out of the window?

Yes.

Actually, it has to do with the fact that when you select text, and scroll the text (the selected text will be outside the visible area in the window), the cursor does not stand still, but moves along with the scrolled content of the window. The cursor should not stand firmly in place while scrolling the window?

chrisbra commented 1 year ago

no, that is not supported. The cursor must stay visible inside the window. When you start scrolling the selection and it moves out of the window, the cursor will be moved to be still visible, which means, the selection will be extended. This is mentioned briefly at :h scrolling

m4c commented 1 year ago

That is, I unnecessarily created confusion. Thank you for your support.