Describe the bug
getmousepos().column returns "the length of the text in bytes" plus one
To Reproduce
vim --clean (or gvim --clean, etc.):echo getmousepos().column6Expected behavior
Output of 5, since :help getmousepos() says "When the position is after the text then 'column' is the length of the text in bytes" and the length of "hello" is 5 bytes.
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.![]()
This is a mistake in the help text. Clicking after the last character returns one more. Otherwise you would not be able to tell the difference between clicking on the last character. I'll update the help.
Closed #8474.
Thanks!
I see that similar behavior is not present for getmousepos().line. For example, if I click below the h in the hello example from above, getmousepos returns 1 for the line. Is that the intended/desired behavior?