-
-
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
WriteQuit #354
WriteQuit #354
Conversation
@@ -2,12 +2,16 @@ | |||
|
|||
import {parseQuitCommandArgs} from './subparsers/quit'; | |||
import {parseWriteCommandArgs} from './subparsers/write'; | |||
import {parseWriteQuitCommandArgs} from './subparsers/writequit'; | |||
|
|||
// maps command names to parsers for said commands. | |||
export const commandParsers = { | |||
w: parseWriteCommandArgs, |
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.
For consistency, can you also stringify 'w' and 'write'?
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.
What do you mean by this?
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.
{
'w': parseWriteCommandArgs,
'write': parseWriteCommandArgs,
...
}
Single-quote around the w
and write
|
||
// Writing command. Taken as a basis from the "write.ts" file. | ||
execute(modeHandler : ModeHandler) : void { | ||
var filename : RegExp = new RegExp("Untitled-[0-9]*"); |
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.
Hmm, this approach is tightly coupled to how VSCode names untitled documents - if they ever change, then saving will break. Is there any other way to check this?
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.
I'll take a look
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.
That was one of the ways I found right through the API. I don't know where else I could get it
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.
Also it’s how we use it in src/cmd_line/commands/write.ts
as well
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.
Eh, if there's really no other way, we can just merge it. It's not that bad.
Finally merged this in! Thank you @srepollock! |
Thank you guys. This is my first contribution to an open source project that's not my own or one of my friends 😄 hope to keep poking around and help work with this when I can |
Congrats! 😄 Hope to see you back again soon. |
WriteQuit
:wq
or:writequit
:wq #198