Skip to content
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

fix(windows): fix folds getting messed up when changing todo state #930

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sahinf
Copy link
Contributor

@sahinf sahinf commented Mar 12, 2025

Summary

Problem: when changing todo state in an orgfile using orgmode-org_todo_prev or orgmode-org_todo_next, the last line in the fold seems to exit the fold. This happens when using nvim_buf_set_text to change the TODO state. It also happens when using nvim_buf_get_lines to add the closing timestamp.

I think it's a neovim issue.
neovim/neovim#30352 might be related.

Changes

Solution: :help zX
Run fold recomputation. zx runs zv which opens the fold after recomputation. zX does not this do. Changing TODO state should not change fold state.

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.
  • [ x] Checked for breaking changes and documented them, if any.

Problem: when changing todo state in an orgfile using
`orgmode-org_todo_prev` or `orgmode-org_todo_next`, the last line in the
fold seems to exit the fold. This happens when using `nvim_buf_set_text`
to change the TODO state. It also happens when using
`nvim_buf_get_lines` to add the closing timestamp.

I think it's a neovim issue.
neovim/neovim#30352 might be related.

Solution: `:help zX`
Run fold recomputation. `zx` runs `zv` which opens the fold after
recomputation. `zX` does not this do. Changing TODO state should not
change fold state.
@kristijanhusak
Copy link
Member

Problem with recomputing folds is that it will recompute folds in whole file. If you have opened few folds above or below the TODO that you are changing, it will also close those after this TODO is switched. I believe most people would not want that to happen.
I'll add neovim-dependency label on this and we'll see if the related issue fixes it.

@kristijanhusak kristijanhusak added the neovim-dependency Limited by Neovim functionality label Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
neovim-dependency Limited by Neovim functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants