-
Notifications
You must be signed in to change notification settings - Fork 250
Implement sentence motions. #886
Conversation
Great work @jonasws. There's still some behavior differences that we might want to look at addressing. For example, in this repo, open While still on line 1340 in the same file, hit The larger conclusion to draw from this is that paragraph and section boundaries don't seem to count as sentence boundaries as the Vim docs say they should. From vim's
Just my 2cents, as I'm not the actual maintainer of this plugin. 😃 |
@mattr That is great feedback! I am not an expert vim user myself, so I figured someone had something to comment on that I completely missed. I also implemented this with the purpose of it to work on files consisting of mainly text (such as Markdown and LaTex), as I didn't think it was defined by vim what would happen when pressing those keys in a code file. I'll look into what vim says to try to make it compliant. |
Ok well the code looks very nice. It seems like a paragraph breaks, or empty lines, should be considered sentence boundaries, but other than that, I'd love to 🚢 this. |
@maxbrunsfeld I have implemented sentence boundaries as we discussed. I have another question that we might want to address. How do we want things to work in "code files", where sentences do not occur as the normally would? I haven't been able to think of anything clever on that account. |
paragraph boundaries..
I don't think you need to change the behavior based on the filetype or context. |
Are you happy w/ this as is, for your use case? If so, I'm fine with merging this as long as the tests pass. We can always refine the behavior in a subsequent PR. |
I am happy with it as it is. As you said, making it work exactly like vim, is quite complex, and should probably be done in another PR, to keep the review work simpler. |
keydown '(' | ||
expect(editor.getCursorBufferPosition()).toEqual [1, 0] | ||
|
||
|
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.
Could you remove this second blank line?
Implement sentence motions.
Thanks @jonasws! |
This PR implements the traditional
)
and(
keybindings originally found in vim. I would greatly appreciate any comments and feedback on how I made it work with regex, as I'm certain there may be a slightly slicker way to pull it off (though I've tried to do similar to how other motions are implemented).