-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
More intuitive priority cycling #236
base: master
Are you sure you want to change the base?
Conversation
Yes it does ... but it does consistently increase (decrease) priority. We could have it loop, i.e. Maybe it would make sense to have a separate cycle up/down command that would do what increase and decrease do atm. But it all ties back to how it's done in emacs. btw - great work on the Clocking summary table 😎 |
|
Good tip! but you still need to write in the priority, so that's 4 keys. Currently I use reduce priority to mark tasks as important - it's one key in the agenda |
A possible solution to this (for the sake of convenience) could be to have a |
Hmm 🤔 maybe a toggle function would be convenient? e.g. |
My previous suggestion is now possible by using the new treesitter functions. Here's an example. local Headline = require('orgmode.treesitter.headline')
local tree_utils = require('orgmode.utils.treesitter')
vim.keymap.set('n', '<some-keymap>', function()
local headline = Headline:new(tree_utils.closest_headline())
headline:set_priority('A')
end) |
4be6263
to
7e42fdb
Compare
9094379
to
abff0dc
Compare
44754e8
to
5143eed
Compare
I'm not sure if it's bound by emacs orgmode behavior, but current priority increase and decrease is a bit counterintuitive.
increase
cyclenone
(default priority) ->[#C]
(low priority) ->[#B]
(default priority) ->[#A]
(high priority) ->none
.decrease
cyclenone
(default priority) ->[#A]
(high priority) ->[#B]
(default priority) ->[#C]
(low priority) ->none
.Thus, the first press actually decreases priority, and then sets it to the initial state, and only then actually increases priority. The reverse is true for
decrease
- one needs to press 3 times to actually reduce priority.In other words to give
[#A]
priority to a task with no priority, the fastest way to do it is by pressingdecrease
priority.This PR modifies the cycle as follows:
increase
cyclenone
(default priority) ->[#A]
(high priority) ->none
[#C]
(low priority) ->[#B]
(default priority) ->[#A]
(high priority) ->none
decrease
cyclenone
(default priority) ->[#C]
(low priority) ->none
[#A]
(high priority) ->[#B]
(default priority) ->[#C]
(low priority) ->none
While it breaks the cycle starting with
none
, theincrease
anddecrease
reflect the change in priority.