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

Refactor commands [WIP] #234

Merged
merged 57 commits into from
Jun 5, 2016
Merged

Refactor commands [WIP] #234

merged 57 commits into from
Jun 5, 2016

Conversation

johnfn
Copy link
Member

@johnfn johnfn commented May 29, 2016

Stuff I did:

  • Add a class for every action
  • Make 3 base types of actions: movements (e.g. h), operators (e.g. d) and commands (e.g. i). There may be more? I'm not sure.
  • Completely rewrite the core processing function. For example (it can't do all this yet, but the infrastructure is there) if you type 5"pdw, it'll gather:
  • * That it's going to happen 5 times
  • * It's going into the p register
  • * It's a delete operation
  • * Then it sees the w and does the whole thing.
  • Handle commands like dw, y} - commands that spell out an operation and a movement to do it over - in a unified manner rather than special casing all of them.
  • Instead of special casing commands that make you switch between modes, they're now just command actions and they work like anything else.
  • Remove CharacterWiseInclusive/Exclusive. We instead handle that stuff in the mode-specific processing in modeHandler.
  • Make aw and iw movements work as arguments to d, y and c.

Actions.allActions.push(new action());
}

@RegisterAction
Copy link
Member

Choose a reason for hiding this comment

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

Oohh! neat, didn't know TS/JS had this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, it's really snazzy. Unfortunately I'm running into some annoying bugs where depending on compile order things might not work, so I might have to remove it...

@johnfn johnfn mentioned this pull request Jun 4, 2016
@johnfn
Copy link
Member Author

johnfn commented Jun 5, 2016

Bah! The tests totally pass. I don't understand why they're timing out on the server.

I'LL JUST DO IT LIVE!!!

@johnfn johnfn merged commit 192861c into master Jun 5, 2016
@jpoon jpoon deleted the refactor-commands branch June 6, 2016 06:34
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.

2 participants