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

Allow moving cursor by prev/next words #10601

Merged
merged 4 commits into from
Dec 5, 2020
Merged

Allow moving cursor by prev/next words #10601

merged 4 commits into from
Dec 5, 2020

Conversation

Swoorup
Copy link
Contributor

@Swoorup Swoorup commented Dec 3, 2020

Fixes: #10593

move-word

New Shortcuts:
Alt+B or Ctrl + Left : Go left (back) one word.
Alt+F or Ctrl + Right: Go right (forward) one word. (If we are at the end of sentence, upon pressing this key, we advance the cursor at end of the line, even though there are no words)

@KevinRansom
Copy link
Member

KevinRansom commented Dec 3, 2020

@Swoorup , hi this is a great feature. Testing it out on my PC, I see a couple of issues.

  1. Ctrl+Left and Ctrl+Right don't work. eyeballing the code, I can't see why ... perhaps check out if it works for you.
  2. Alt + B works fine moving to the start of the previous word. However Alt + F puts the caret before the last character of the current word.

Before:
image

After Alt+F
image

@Swoorup
Copy link
Contributor Author

Swoorup commented Dec 4, 2020

@KevinRansom Fixed the issue. I noticed some shells like python use multiple stop characters (stopping on ',") when moving words compared to when deleting word which just looks for spaces, but we could always improve this later on.

@Swoorup
Copy link
Contributor Author

Swoorup commented Dec 4, 2020

@KevinRansom regarding the ctrl, I can't test it since i don't have a windows box :(

But I think the issue was because the first match block wasn't filtering out Ctrl modifiers keys. Let me know if you find issues.

Copy link
Contributor

@cartermp cartermp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This works great on Windows as well.

@cartermp
Copy link
Contributor

cartermp commented Dec 5, 2020

Just to note: tested it all and it works as per @KevinRansom's feedback

@cartermp cartermp merged commit 44dada7 into dotnet:main Dec 5, 2020
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
@Swoorup Swoorup deleted the sj_more_fsi_shortcuts branch June 3, 2021 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Ctrl + Left/Right word moves in fsi
3 participants