-
-
Notifications
You must be signed in to change notification settings - Fork 161
fix(agenda): make spans work like emacs #915
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
Conversation
Emacs parity with jumping to the next week/month should already be in place If that's not working, let me know how to reproduce. Regarding the week number, that's fine, we can add that. |
You're right, the cursor does already follow the date as spans change. But the view span still isn't the same as with emacs. You can reproduce by switching to month view from week view on emacs and on orgmode.nvim. Notice the first entry in the agenda. In emacs, it will be the first day of the month the cursor was on. In orgmode.nvim, it will be the first day of the week (Monday on my end) instead. Scroll to a later week in the month and switch back to week view. Notice that in emacs, the new week view will start with the day of the week right before the day the cursor was on. While on orgmode.nvim it will go to the first week showing in the month view. And the same for day view and year view. Switching to day view always goes to Monday for me when I expect it remain on the day my cursor was on like in emacs. Let me know if this doesn't make sense I will try to record it. |
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.
Thanks for the explanation! Now I understand what you mean.
I left few comments, and once addressed this is good to go.
Currently, view month and view day both shift the cursor to and start the view's span from the start day (Monday by default). In emacs, all view changes take into account the agenda date that the cursor is on, and then choose the beginning date accordingly. These changes aim to mimic emacs behavior by 1. modifying all view changes to stop moving the cursor 2. displaying the W number in all spans types 3. change the first day of the view to be the first day of the span Reuse existing function OrgDate:start_of(span) Ensure start is on user configured start week for initial week view as well Co-authored-by: Kristijan Husak <[email protected]>
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.
Looks good, thanks!
Summary
This PR adds.. Core feature parity with emacs agenda views. All view changes should take into account the cursor position.
Currently, view month and view day both shift the cursor to and start the view's span from the start day (Monday by default). In emacs, all view changes take into account the agenda date that the cursor is on, and then choose the start date accordingly. These changes aim to mimic emacs behavior by
Changes
To expand on 3, month view should change the view to start with the first day of the month that the user's cursor is on when the changing spans. I verified that this behavior is consistent with all views in emacs. It's also the behavior that I would expect when changing views.
I additionally added a day-of-the-year tracker next to the week-of-the-year tracker.
Checklist
I confirm that I have:
Conventional Commits
specification (e.g.,
feat: add new feature
,fix: correct bug
,docs: update documentation
).make test
.