You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While playing around with Hydra.nvim to create a convenient way to reorder headlines and subtrees, I discovered, that the cursor position after moving the subtree up or down doesn't allow for convenient repetition. If the current tree has no child items, everything works fine, but as soon as it has child items, the behavior of placing the cursor at the last line after the movement (which just happens automatically, if we don't take additional care) ends in "Cannot move past superior level" with the next attempt to move the subtree, even the move would be valid.
I propose to set the cursor to the heading which get's moved around as soon as the command ends.
Steps to reproduce
Example org file:
* Heading
** Subheading1
some content
** Subheading2
** Subheading3
*** Child heading
more content
Try to move Subheading3 up twice.
Expected behavior
Command should be repeatable without any quirk.
Emacs functionality
I don't remember any issues with this in Emacs
Minimal init.lua
Nothing of relevance here.
Screenshots and recordings
No response
OS / Distro
Linux
Neovim version/commit
0.10
Additional context
I wile provide a PR with a fix.
The text was updated successfully, but these errors were encountered:
* tests: improve test cases for subtree move
- repeated move
- evaluate cursor position after move
* fix: cursor position after moving subtree
To allow for repetition of moving a subtree, the cursor must stay on the
headline.
* fix: preserve folding when moving subtree
To be consistent with promotion and demotion commands, we preserve the
folding state also when moving a subtree.
---------
Co-authored-by: Sebastian Flügge <seflue@users.noreply.github.com>
Describe the bug
While playing around with Hydra.nvim to create a convenient way to reorder headlines and subtrees, I discovered, that the cursor position after moving the subtree up or down doesn't allow for convenient repetition. If the current tree has no child items, everything works fine, but as soon as it has child items, the behavior of placing the cursor at the last line after the movement (which just happens automatically, if we don't take additional care) ends in "Cannot move past superior level" with the next attempt to move the subtree, even the move would be valid.
I propose to set the cursor to the heading which get's moved around as soon as the command ends.
Steps to reproduce
Example org file:
Try to move
Subheading3
up twice.Expected behavior
Command should be repeatable without any quirk.
Emacs functionality
I don't remember any issues with this in Emacs
Minimal init.lua
Nothing of relevance here.
Screenshots and recordings
No response
OS / Distro
Linux
Neovim version/commit
0.10
Additional context
I wile provide a PR with a fix.
The text was updated successfully, but these errors were encountered: