Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cursorWordLeft and cursorWordLeftSelect do not behave consistently #74369

Closed
brian-mann opened this issue May 26, 2019 · 2 comments
Closed

cursorWordLeft and cursorWordLeftSelect do not behave consistently #74369

brian-mann opened this issue May 26, 2019 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug editor-wordnav Editor word navigation issues verified Verification succeeded
Milestone

Comments

@brian-mann
Copy link

brian-mann commented May 26, 2019

Issue Type: Bug

Given the following keybindings...

{
  "key": "alt+left",
  "command": "cursorWordLeft",
  "when": "inputFocus"
},
{
  "key": "shift+alt+left",
  "command": "cursorWordLeftSelect",
  "when": "inputFocus"
}

Moving from right to left using cursorWordLeft moves the cursor like so...

this.is.a.test|
this.is.a.|test
this.is.|a.test
this.|is.a.test
|this.is.a.test

This is great - this is exactly what I want.

However moving from right to left with select using cursorWordLeftSelect moves the cursor like so...

this.is.a.test|
this.is.a.|test
this.is.a|.test
this.is.|a.test
this.is|.a.test
this.|is.a.test
this|.is.a.test
|this.is.a.test

It takes 7 keystrokes using select vs the 4 you get with just regular cursor word left.

Note: this bug applies ONLY to moving from right to left. Moving the opposite direction with select works perfectly fine.

VS Code version: Code 1.34.0 (a622c65, 2019-05-15T21:59:22.738Z)
OS version: Darwin x64 18.5.0

@vscodebot vscodebot bot added the editor-autoindent Editor auto indentation issues label May 26, 2019
@victorteokw
Copy link

Hi @brian-mann, this is interesting and I think they do this by design. How about having a toggle setting in the setting to toggle the behavior? It's by default behaves like normal and when it's on, it behaves exactly what you want: always move active point of the selection one char left or right regardless where the anchor point is.

@brian-mann
Copy link
Author

brian-mann commented May 27, 2019

I don't think this is by design - because moving from left to right works identically with both cursor movements and the movements with select.

In fact - I'm pretty sure this is behaving as the cursorMoveEndLeft, which is wrong because they are supposed to behave differently.

@alexdima alexdima added editor-wordnav Editor word navigation issues bug Issue identified by VS Code Team member as probable bug and removed editor-autoindent Editor auto indentation issues labels Jul 25, 2019
@alexdima alexdima added this to the July 2019 milestone Jul 25, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug editor-wordnav Editor word navigation issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants