-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add Sentence motion (, ) #441
Comments
@bronson |
You mean moveToEndOfString? Oops, right. That was from before the regex was smart. Glad that hack is not needed anymore, good fixups! Now that we have sentence motion, how hard is that to turn into a text object? |
http://vimdoc.sourceforge.net/htmldoc/motion.html#sentence
|
Yep, I put that info in a comment in #439. :) My question is: in vim-mode-plus, how similar are motions and text objects? Once you have a motion, does the text object fall out easily? Or are they fairly separate? |
Separated, conceptually its' similar and code is reusable, but at least now I'm basically avoid reusing text-object in motion code or vise versa. development of vim-mode-plus is open-end process from "adding feature also add mess" then "reducing that mess by overhauling existing code". If I go too much abstraction or sophistication, overhauling, refactoring would become very difficult. So treat motion, textobject, operator independently is my strategy at now. |
That makes total sense. A sure way to make a project late is to perform a lot of abstraction up front. |
Yep, I tried several time in my local experiment, but I learned too much abstraction also restrict me. So explicitness, separateness, not depending to other part leads less brain confusion. |
As a result of try&error I removed original code. |
Oh no, I'm sorry to see these changes. I understand you're trying for 100% vim compatibility, but I think Vim's behavior here is buggy. (and that's probably why it's so hard to match). Why would the first blank line following a sentence be considered a sentence? Vim's docs don't say anything about this, and it doesn't make intuitive sense to me. Personally, I liked it better before, where it just matched sentences. I understand why bug-for-bug compatibility would be desirable, though, so I can live with this too. |
Actually, would this be a good opportunity for a vim-mode-plus plugin? vim-mode-plus-better-than-vim-sentence-motion? |
So you like previous behavior right? |
Umm, I understand your point. Yes, pure-vim's behavior is inconsistent between next and previous movement. I'll think about that after I finished cleanup and might give some option or another motion to skip blank row after sentences. |
Naw, v-m-p already has too many options. :) Yes, I liked it better before. I don't understand why sentence motion would ever stop on a blank line. This is one place where I think it makes sense to ALMOST do what Vim does, especially if it makes the code simpler. But I'm happy to go with whatever you choose. |
I understand your point and agree with you. But what motivate me to develop vim-mode-plus is many user from pure-Vim to Atom can easily migrate with small frustration. So I cannot decide easily. But glad to hear that I could know that I'm not only one who think original sentence behavior is not comfortable. |
I remember vim-mode said they wanted to be compatible with Vim, but not bug-for-bug compatible. If it simplified the code or fixed an apparent bug, they'd prefer to break with Vim. Otherwise, little inconsistencies would be stuck in our lives forever. (if I remember the argument correctly) It sounds like vim-mode-plus wants to adhere much closer to actual Vim behavior? That makes sense too. I agree -- if v-m-p frustrates Vim users, then it's not doing its job. Judgement calls aren't easy! |
Before, you were talking about the SmartWord text object? It seems like that uses /[\w-]+/ instead of Atom's wordRegex? Or is there more to it than that? |
I no longer user Atom's native word selecting function. |
@bronson 'atom-text-editor.vim-mode-plus:not(.insert-mode)':
')': 'vim-mode-plus:move-to-next-sentence-skip-blank-row'
'(': 'vim-mode-plus:move-to-previous-sentence-skip-blank-row'
I think this is what you want behavior but want to confirm. |
Not always, it's always depends on situation. But what I want is stress-free-editor-for-my-personal-use. in this perspective, compatibility is NOT important. Postponing BIG decision, until I have enough background, motivation, convince to drop compatibility. |
haha, yeah, you probably hit on the best solution. Glad to not have more options. I'll play with both bindings... And I might submit a delete-bronson's-preferred-sentence-motion PR in the future. Less code always wins, even if it's just slightly less. Agreed, we'll see. Thanks for all the considerations! |
Thanks for checking the behavior, I'll release in a few days. |
Gotta say, I really like the skip-blank-row behavior. And your implementation is simple, easy to use, and doesn't bloat the settings dialog. ❤️ 💚 ❤️ |
Not sure, I still like your idea to limit-scan-range-to-paragraph-boundary-first. But original PR have to fixed for case move-to-previous-sentence stuck when there is line-end-with-period( So will re-visit I have time. |
Continuation of #439
Originally reported on #67. #67 is for both sentence motion and sentence text-object.
The text was updated successfully, but these errors were encountered: