This repository has been archived by the owner. It is now read-only.

Implement operator pending mode and text objects #183

Merged
merged 11 commits into from Mar 19, 2014

Conversation

Projects
None yet
5 participants
@nathansobo
Contributor

nathansobo commented Mar 19, 2014

馃殘 In progress 馃殘

This PR adds operator pending mode. It also refactors how commands are registered and how operations are pushed and processed.

  • i w
  • a w
  • sentence text objects (i s and a s)
  • paragraph text objects (i p and a p)
  • quote text objects (i " etc)
  • bracket text objects (i ( etc)
  • indent text objects (ii and ai)

Closes #177

@nathansobo

This comment has been minimized.

Show comment
Hide comment
@nathansobo

nathansobo Mar 19, 2014

Contributor

Shout out to @jroes for taking a stab at this in #152.

Contributor

nathansobo commented Mar 19, 2014

Shout out to @jroes for taking a stab at this in #152.

@jroes

This comment has been minimized.

Show comment
Hide comment
@jroes

jroes Mar 19, 2014

Contributor

Yeah! Lovin' it. Glad you decided to continue on the clarity train with operation btw.

Contributor

jroes commented Mar 19, 2014

Yeah! Lovin' it. Glad you decided to continue on the clarity train with operation btw.

@lloeki

This comment has been minimized.

Show comment
Hide comment
@lloeki

lloeki Mar 19, 2014

Contributor

and text objects

This is awesome and really important in order to make this vim-mode not merely a thin key binding shim. It does not have to be a full vim port but having real composability of verbs/adjectives/objects is the key.

Contributor

lloeki commented Mar 19, 2014

and text objects

This is awesome and really important in order to make this vim-mode not merely a thin key binding shim. It does not have to be a full vim port but having real composability of verbs/adjectives/objects is the key.

@mcolyer mcolyer referenced this pull request Mar 19, 2014

Closed

Operator pending #152

'/': 'vim-mode:search'
'?': 'vim-mode:reverse-search'
'n': 'vim-mode:repeat-search'
'N': 'vim-mode:repeat-search-backwards'

This comment has been minimized.

@bhuga

bhuga Mar 19, 2014

Contributor

These should also work in visual mode. Guess I need a test for that.

@bhuga

bhuga Mar 19, 2014

Contributor

These should also work in visual mode. Guess I need a test for that.

Show outdated Hide outdated lib/text-objects.coffee Outdated
@history.unshift(poppedOperator) if poppedOperator.isRecordable()
poppedOperator.execute()
@history.unshift(poppedOperation) if poppedOperation.isRecordable()
poppedOperation.execute()

This comment has been minimized.

@bhuga

bhuga Mar 19, 2014

Contributor

Could we put @activateCommandMode() here and remove it from all the operators?

@bhuga

bhuga Mar 19, 2014

Contributor

Could we put @activateCommandMode() here and remove it from all the operators?

This comment has been minimized.

@nathansobo

nathansobo Mar 19, 2014

Contributor

I remember either thinking about doing that or trying it and hitting a hangup, but I can't remember why. It might not be relevant anymore now that I've cleaned up what we call this method with. What are the circumstances in which we should reactivate command mode? When the op stack is empty? When the executed command was an operator? Always?

@nathansobo

nathansobo Mar 19, 2014

Contributor

I remember either thinking about doing that or trying it and hitting a hangup, but I can't remember why. It might not be relevant anymore now that I've cleaned up what we call this method with. What are the circumstances in which we should reactivate command mode? When the op stack is empty? When the executed command was an operator? Always?

This comment has been minimized.

@nathansobo

nathansobo Mar 19, 2014

Contributor

Ah yes, not all operators want to go back to command mode. For example, change leaves us in insert mode.

@nathansobo

nathansobo Mar 19, 2014

Contributor

Ah yes, not all operators want to go back to command mode. For example, change leaves us in insert mode.

@bhuga

This comment has been minimized.

Show comment
Hide comment
@bhuga

bhuga Mar 19, 2014

Contributor

Merging this. This is the hard part of the diff, and it will be impossible to keep it up to date with master. New text objects can be added cleanly in another pull.

@nathansobo 鉂わ笍

Contributor

bhuga commented Mar 19, 2014

Merging this. This is the hard part of the diff, and it will be impossible to keep it up to date with master. New text objects can be added cleanly in another pull.

@nathansobo 鉂わ笍

bhuga added a commit that referenced this pull request Mar 19, 2014

Merge pull request #183 from atom/ns-operator-pending
Implement operator pending mode and text objects

@bhuga bhuga merged commit 5e69b2a into master Mar 19, 2014

@bhuga bhuga deleted the ns-operator-pending branch Mar 19, 2014

@willcosgrove willcosgrove referenced this pull request Apr 9, 2014

Closed

Motion: i (inside) #200

@clintberry

This comment has been minimized.

Show comment
Hide comment
@clintberry

clintberry Jun 5, 2014

so is this in a state now where we just need to add the keybindings manually for i ", i {, etc? I see i w was added so that is awesome.

clintberry commented Jun 5, 2014

so is this in a state now where we just need to add the keybindings manually for i ", i {, etc? I see i w was added so that is awesome.

@bhuga

This comment has been minimized.

Show comment
Hide comment
@bhuga

bhuga Jun 5, 2014

Contributor

#286 implements those. It will land 馃敎

Contributor

bhuga commented Jun 5, 2014

#286 implements those. It will land 馃敎

@nubs nubs referenced this pull request Nov 5, 2014

Closed

change inside " #303

MarkusSN pushed a commit to MarkusSN/vim-mode that referenced this pull request May 28, 2015

Merge pull request atom#183 from atom/ns-operator-pending
Implement operator pending mode and text objects
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.