Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
wants to merge 1 commit into from

3 participants

@alexleach

Fix for #164

One minor change to Default.sublime-keymap.

@princemaple

@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".

@alexleach

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"}]
    }
@princemaple

@alexleach <3 hahahaha

Alex Leach Rebase 3 separate commits into one. Fixes #151, fixes #164 and fixes #…
…173. Relates to the s command-mode key, being off by one.
9f88693
@alexleach

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.

@Hubro

:+1: Please pull this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 15, 2013
  1. Rebase 3 separate commits into one. Fixes #151, fixes #164 and fixes #…

    Alex Leach authored
    …173. Relates to the s command-mode key, being off by one.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 3 deletions.
  1. +2 −3 Default.sublime-keymap
View
5 Default.sublime-keymap
@@ -852,9 +852,8 @@
{ "keys": ["s"], "command": "set_action_motion", "args": {
"action": "enter_insert_mode",
- "action_args": {"insert_command": "vi_delete"},
- "motion": "vi_move_by_characters_in_line",
- "motion_args": {"forward": true, "extend": true, "visual": false }},
+ "action_args": {"insert_command": "right_delete"},
+ "motion": "expand_selection" },
"context": [{"key": "setting.command_mode"}]
},
Something went wrong with that request. Please try again.