-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Use buffer mappings #43
Conversation
FYI: I will check the tests later this week. |
<Tab> and <S-Tab> are the most obvious mappings, but to dedicate them to doge (and in all modes) is very demanding. Use buffer mappings instead, so that they are only active in 'doge-mode', and unmapped when finished. Deactivation is either automatic (end of placeholders, press outside of comment area) or manual (main mapping is pressed again).
Pressing <Tab> at the last placeholder would enter a tab, even if there are placeholders left before it, let it cycle back to the first one. Similarly, if currently at the first placeholder and pressing <S-Tab>, jump to the last placeholder.
Do not enable buffer mappings if g:doge_comment_interactive is false. Also use explicit check (v:true).
Pressing the main mapping after activation shouldn't trigger deactivation.
Default behaviour remains as it was. User must set g:doge_buffer_mappings to 1 if buffer mappings are preferred. Add option to documentation. Also made messages for activation/deactivation disabled by default (they're still undocumented).
Tests fail if cycling among placeholders is allowed by default, so I'm restricting this behaviour to the case that buffer mappings have been activated.
vint was complaining about local scopes and such
I rebased and made tests pass. Tests were probably failing because hitting Right now every difference is optional and must be enabled with
|
This PR can be simplified a lot, I'm dumping it and making a new one. |
Prelude
Thank you for helping out DoGe!
By contributing to DoGe you agree to the following statements (Replace
[ ]
with[x]
with those you agree with):Why this PR?
<Tab>
and<S-Tab>
are the most obvious mappings, but to dedicate them todoge (and in all modes) is very demanding. Use buffer mappings instead,
so that they are only active in 'doge-mode', and unmapped when finished.
Deactivation is either automatic (end of placeholders, press outside of
comment area) or manual (main mapping is pressed again).
The first commit didn't give me troubles. The second commit requires some testing (I had a recursion once, then I changed it and it looks ok but some more testing is needed).