-
Notifications
You must be signed in to change notification settings - Fork 43
Description
Summary
When command_mode is active, using the mouse to change the cursor position does not work as expected in a certain case. This case is when clicking on the very last clickable position in a line, i.e. on the newline character.
It seems like the mouse click is unable to set the actual cursor position but succeeds in setting the rendered cursor position in this case.
I've already posted about this in the forums. Here's the link: https://forum.sublimetext.com/t/command-mode-cursor-jumps-back/23733
Expected behavior
When clicking beyond the last character in a line with the mouse, i.e. on the newline character, the cursor should jump and stay to the left of the newline character. Trying to insert a new character at that point should insert it before the newline character, just like when the cursor is anywhere else on that line. Also, when leaving command mode, the cursor should stay where it is.
Actual behavior
When clicking beyond the last character in a line with the mouse, i.e. clicking on the newline character, the cursor should jump to the left of the newline character. However, the cursor then jumps to the left by one textpoint. Clicking on the same spot again, the cursor appears to be in the correct position.
- Trying to insert a new character at that point puts the cursor one to the left again and inserts the character in the wrong position, i.e. before the last non-newline character in the line.
- Leaving command mode at this point, the cursor is set back one character to the left as well. Entering and leaving command mode then does not change the cursor position at all, though.
Steps to reproduce
- Enter command mode:
view.settings().set('command_mode', True) - Use the mouse to click on the end of some line.
- Watch the cursor jump to the left by 1 character.
- Click on the same spot again to see the cursor jumping to the desired position.
- Either insert a character somehow (plugin, command) or leave command mode:
view.settings().set('command_mode', False) - Watch the cursor jump back one character again, placing it before the last non-newline char in that line.
Environment
- Operating system and version:
- Windows 10 Education, Version 1607, OS Build 14393.321
- Mac OS NOT TESTED
- Linux NOT TESTED
- Sublime Text:
- Build 3126
