-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Capital W/B word movement #147
Conversation
- update regex so as to treat “) {“ as two words instead of one - update word movements to use indexes returned by regex directly - fix b/B behavior when moving up a line - fix w/W behavior when moving down a line
@@ -23,8 +23,10 @@ export class NormalMode extends Mode { | |||
"gg" : async (c) => { return c.firstLineNonBlankChar().move(); }, | |||
"G" : async (c) => { return c.lastLineNonBlankChar().move(); }, | |||
"w" : async (c) => { return c.wordRight().move(); }, | |||
"W" : async (c) => { return c.WORDRight().move(); }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a big fan of differentiating functions using casing. I understand that vim differentiates using word vs. WORD, but I'm wondering if there are alternatives?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not usually a fan either. Though I figured in this case it would be the most obvious vocabulary for someone familiar with vim.
I took a look at various other projects to see what they use, and I think I like "Big Word" the best. Still short, and the connection can be made to WORD pretty easily and recalled easily. I'll make an update to the pull request.
Updated. |
this._nonBigWordCharRegex = this.makeWordRegex(Position.NonBigWordCharacters); | ||
} | ||
|
||
private makeWordRegex(characterSet: string) : RegExp { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: mind moving the f(x) around such that public comes first then privates?
Awesome Thanks! Mind also updating the Readme? I'll push an update to the extension following this PR merge. Sidenote: I should setup a continuous delivery system. Such that every time we push to a stable branch, it auto publishes it to VSCE. I'll file an issue to track this actually :) |
Meh, we'll update the readme later -- want to push a new version out. |
Implement W/B WORD movements