orgmode icon indicating copy to clipboard operation
orgmode copied to clipboard

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

Open sahinf opened this issue 9 months ago • 1 comments

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. https://github.com/neovim/neovim/issues/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.

sahinf avatar Mar 12 '25 22:03 sahinf

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 avatar Mar 13 '25 08:03 kristijanhusak