Vintage icon indicating copy to clipboard operation
Vintage copied to clipboard

Fix for Issue #164: 's' after selecting text in visual mode off-by-one

Open alexleach opened this issue 12 years ago • 5 comments
trafficstars

Fix for https://github.com/sublimehq/Vintage/issues/164

One minor change to Default.sublime-keymap.

alexleach avatar Jan 24 '13 17:01 alexleach

@alexleach Actually, there's one more bug caused by right delete. When the cursor is at the end of a line (command mode, so it's not the actual line end) , regardless there's anything selected, if you try using "s", the deletion acts nicely but the position ends up weird. Say "abcdefg" is the whole line, your cursor (command mode) is under g, you press s, g will be correctly deleted, but the cursor will be between "e" and "f", not after "f".

princemaple avatar Jan 25 '13 01:01 princemaple

Yes, you're right. I noticed that, and have just found the fix. The 'vi_right_delete' insert_command moves each cursor back one, when it's at the end of the line. There is also a 'right_delete' insert_command which can be used instead. This seems to exhibit the right behaviour ;) i.e.

    { "keys": ["s"], "command": "set_action_motion", "args": {
        "action": "enter_insert_mode",
        "action_args": {"insert_command": "right_delete"},
        "motion": "expand_selection" },
        "context": [{"key": "setting.command_mode"}]
    }

alexleach avatar Jan 25 '13 01:01 alexleach

@alexleach <3 hahahaha

princemaple avatar Jan 25 '13 01:01 princemaple

Just to make sure you're informed: I've tidied up the Pull Request into a single commit, so that should make it a lot easier to see the changes I've made. I've been using this configuration for some months now, so I can confirm that it works exactly as expected.

alexleach avatar May 15 '13 11:05 alexleach

Going to pull this one to https://github.com/SublimeText/Vintage-Extended-Support @alexleach @Hubro

princemaple avatar Oct 16 '15 10:10 princemaple