Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(statistics cookie): count only TODO headlines #938

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

seflue
Copy link
Contributor

@seflue seflue commented Mar 17, 2025

@kristijanhusak Sorry to open this again, I made a mistake when creating the original PR from Octo.nvim: The base branch selected was the master branch from my forked repository, not the original upstream repository. So the PR merge went into the wrong branch.

Old PR message

Previously, the todo statistics cookie was counting all child headlines in its calculation, regardless of whether they had TODO keywords. This fix modifies the update_todo_cookie function to:

  1. Filter child headlines to only those with valid TODO keywords
  2. Calculate the ratio of DONE tasks to total tasks with TODO keywords
  3. Update the cookie with the correct statistics

This ensures consistency with Org Mode's behavior where non-task headlines are excluded from statistics calculations.

Summary

This PR adds..

Related Issues

Related #

Closes #

Changes

  • List changes here

Checklist

I confirm that I have:

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

Previously, the todo statistics cookie was counting all child headlines in
its calculation, regardless of whether they had TODO keywords. This fix
modifies the `update_todo_cookie` function to:

1. Filter child headlines to only those with valid TODO keywords
2. Calculate the ratio of DONE tasks to total tasks with TODO keywords
3. Update the cookie with the correct statistics

This ensures consistency with Org Mode's behavior where non-task headlines
are excluded from statistics calculations.
Copy link
Member

@kristijanhusak kristijanhusak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured out I'm missing the merge button 😄

@kristijanhusak kristijanhusak merged commit 5d7c03a into nvim-orgmode:master Mar 17, 2025
17 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants