8000 Add subword movement support by deiwin · Pull Request #769 · atom/vim-mode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Apr 6, 2018. It is now read-only.

Add subword movement support #769

Closed
wants to merge 17 commits into from

Conversation

deiwin
Copy link
Contributor
@deiwin deiwin commented Jul 12, 2015

I will be fleshing out some ideas for #377 in this PR. Comments and feedback are welcome. When all of the main changes are made and you agree and are happy with them, I can clean up the commit history and add the necessary documentation etc.

The general idea is that there will be 3 different definitions of a word. The main one, an alternative one and the space delimited (WORD) one. The only difference between the main and the alt one would be that one of them would be sensitive to camel (and snake?) casing and the other would not.

TODO:

  • add a configuration option that says whether a CamelCase sensitive or insensitive definition of a word is used by default
  • add an alternative version for the w movement
  • add an alternative version for the b movement
  • add an alternative version for the e movement
  • add an alternative version for the w text object
  • ? add an alternative version for the Ctrl-w binding in the insert mode

deiwin added 8 commits July 12, 2015 16:29
As far as I understand it currently works as expected.
atom/atom@ba3ab41 changed the behavior of the
subword regex. Now, for example, if moving the cursor with alt-right, the
end of line and beginning of the next line will also be jumped to. This is
inconsistent with how ctrl-right behaves.
@deiwin
Copy link
Contributor Author
deiwin commented Jul 12, 2015

atom/atom@ba3ab41 from atom/atom#7612 makes the subword regex match line endings if there's any trailing whitespace and line beginnings if it's followed by any whitespace. I currently worked around it, but I think the regex should be changed.

deiwin added 2 commits July 12, 2015 21:23
This reverts commit 145e60f.

# Conflicts:
#	spec/motions-spec.coffee
@deiwin
Copy link
Contributor Author
deiwin commented Jul 12, 2015

Can someone please help me figure out why some of the tests fail when I use alt as a modifier? They seem to work just fine when actually used. I tried messing around with the way the spec-helper dispatches keyboard events, but to no avail.

@jacekkopecky
Copy link
Contributor

This is a guess: it seems to me that CI is complaining about the presence of focused specs. Please try changing fdescribe to describe.

@jacekkopecky
Copy link
Contributor

I like the procedurally generated tests with itMovesByWord and itMovesBySubWord, by the way!

@deiwin
Copy link
Contributor Author
deiwin commented Jul 13, 2015

I'd kept the focused specs because I hadn't really gotten them to pass on my own machine yet and wasn't worrying too much about the CI build. I added a commit to change that now, however, so that the CI logs would show the actual problem I'm facing.

@deiwin deiwin force-pushed the add-subword-movement-support branch from 5b30698 to 9600b31 Compare July 15, 2015 20:30
@deiwin
Copy link
Contributor Author
deiwin commented Mar 29, 2016

Not working on this anymore

@deiwin deiwin closed this Mar 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0