MacVim selects one letter more to the right when selecting by mouse
Steps to reproduce
- write text
- put cursor in the middle of the word
- select backwards few letters by clicking mouse
- One letter more to the right has been selected
Screen recording with --clean parameter
https://github.com/user-attachments/assets/df0712a1-63de-4231-8d8f-b7c1bb2ccd0a
Expected behaviour
Other editors, input fields and terminals doesn't exhibit this behaviour. They select exactly the text requested to be selected.
I've tried: Notes.app, Terminal.app, Kitty, Alakritty, VSCode/VSCodium, Jetbrains editors, chat apps, various browsers
Screen recording from Notes.app
https://github.com/user-attachments/assets/8b10f823-66a6-46fc-a2cf-31ae5adb1bbb
Version of MacVim
MacVim r182 (Vim 9.1.1887)
MacVim installation method
GitHub releases
Environment
macOS Version: 15.7.2
Logs and stack traces
Vim and MacVim configuration where issue is reproducable
No response
How was MacVim launched?
- [x] by launching MacVim.app in macOS (by using the Dock, Spotlight, or the
opencommand) - [x] by running mvim/gvim in the terminal
Issue has been tested with clean configuration
- [x] by running
mvim --clean(orgvim, supplied by MacVim distribution). You can also use the File → "New Clean Window" menu item within MacVim. - [x] by running
vim --clean(in terminal, supplied by MacVim distribution) - [x] by running
vim --clean(in terminal, other suppliers, e.g. /usr/bin/vim)
Other editors, input fields and terminals doesn't exhibit this behaviour. They select exactly the text requested to be selected.
Vim does not behave like native input text fields. You click on a character to move the cursor there, which would select it. MacVim doesn't try to mimic native text input if it conflicts with how Vim works. You can try to play around with set selection=exclusive but it only works for selecting to the right, not selecting to the left.
Note that the Apple native text input behaves in a way that's a bit more complicated than what you described. It depends if you click on the left half or the right half or a character and macOS will do exclusive/inclusive selection respectively.