-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
<C-A> to increase date will increase the year if cursor is not on the date #19
Comments
If you think it's worth fixing, I could actually try to fix it myself. I don't have much experience with lua, but this doesn't seem to be too hard to fix. |
Idea is to have / increment/decrement date by one day when used within date context. Anything outside of it fallback to the default behavior. As you said, Vim automatically finds first number and increases it. I don't think there's a way to prevent it from doing that. Workaround is to bind date increment/decrement to another mapping, for example +/-: require('orgmode').setup({
mappings = {
org = {
org_increase_date = '+',
org_decrease_date = '+'
}
}
}) That way / will work by default everywhere. |
I tried what you suggested, but it seemed to give the same behaviour as So I guess what I'm asking for is that |
Oh, right, I need to fix that fallback to fallback to the defined mapping. We could handle it by jumping to next number manually and then re-checking if it's date or not. Thanks for suggestion, I'll try to fix it. |
@kvalv I pushed a fix for this.
Let me know if it works as expected. |
Hey, nice to hear you worked on this!
simplescreenrecorder-.39.mp4 |
Hey, yes you are right about that. I added this to the config:
and after removing that mapping it works as expected. Really nice, thank you very much! I guess this can be closed then. |
Hey, this is a really nice project and I'm happy to see such active development on this. It already looks promising!
Describe the bug
Using
<C-a>
when the cursor is not on the date will increment the year, and thereafter it'll work properly.To Reproduce
Steps to reproduce the behavior:
:now:
and exit insert mode.0
(zero) )<C-a>
<C-a>
the day increases, as expected.Expected behavior
The date should increase by one day when I type
<C-a>
, even if the cursor is not on the date object.Screenshots
simplescreenrecorder-.37.mp4
System information:
Additional context
<C-a>
normally finds the closest number and increase it, so it makes sense that the first<C-a>
increase the year (that's vim builtin behaviour). Subsequently the cursor is on the date object, and orgmode<C-a>
functionality takes precedence and increase the day. However, I consider this a bug because the expected behaviour is that<C-a>
should "do the right thing" and increase the date immediately.I guess also
<C-x>
have the same issue.The text was updated successfully, but these errors were encountered: