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

WriteQuit #354

Merged
merged 4 commits into from
Jul 4, 2016
Merged

WriteQuit #354

merged 4 commits into from
Jul 4, 2016

Conversation

srepollock
Copy link
Contributor

@srepollock srepollock commented Jun 25, 2016

WriteQuit

  • :wq or :writequit
  • only works on a file that has already been made and saved already
  • need to work on file name parsing for future saving
    :wq #198

@@ -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,
Copy link
Member

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'?

Copy link
Contributor Author

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?

Copy link
Member

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]*");
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Member

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.

@johnfn johnfn merged commit 893d946 into VSCodeVim:master Jul 4, 2016
@johnfn
Copy link
Member

johnfn commented Jul 4, 2016

Finally merged this in! Thank you @srepollock!

@srepollock
Copy link
Contributor Author

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

@johnfn
Copy link
Member

johnfn commented Jul 4, 2016

Congrats! 😄 Hope to see you back again soon.

@jpoon jpoon mentioned this pull request Jul 5, 2016
Closed
This pull request was closed.
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.

4 participants