orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

feat(cookie): implement virtual cookies

Open PriceHiller opened this issue 4 months ago • 3 comments

Summary

This PR adds virtual cookies, a way of using extmarks to get live updating cookies for progress.

Currently it is only implemented for headlines, does not support list items.

This slightly modifies the headlines class to expose progress amounts from the headlines.

The virtual cookies prioritize list checkboxes over todo checkboxes for determining progress. Would it be preferred to flip that OR combine the totals from both as our progress?

Virtual cookies are gated behind ui.cookies_use_extmarks and are disabled by default.

I have not added tests for them, I consider them largely experimental (though pretty robust from my experience) and didn't allocate the time to write tests for them.

See more details from my earlier comment (https://github.com/nvim-orgmode/orgmode/issues/745#issuecomment-2902634050) for additional information.

Related Issues

Closes #745

Changes

  • Added virtual cookie implementation
  • Exposed progress counts for cookies in the Headline class
  • Updated docs to include new feature in configuration.org
  • Added Org cookie_mode command for toggling cookies on & off in the current buffer

Checklist

I confirm that I have:

  • [x] Followed the Conventional Commits specification (e.g., feat: add new feature, fix: correct bug, docs: update documentation).
  • [x] My PR title also follows the conventional commits specification.
  • [x] Updated relevant documentation, if necessary.
  • [x] Thoroughly tested my changes.
  • [x] Added tests (if applicable) and verified existing tests pass with make test. (Ensured existing tests still pass)
  • [x] Checked for breaking changes and documented them, if any.

PriceHiller avatar Jun 02 '25 00:06 PriceHiller