Skip to content

Add remove with a movement function #258

Open
@mrkam2

Description

@mrkam2

Problem/Opportunity
Sometimes it is hard to use remove because it always selects the previous node in a depth-first traversal. So after removing a selection may move arbitrarily deep in the tree structure. I propose to have an alternative version that applies a given traversal function so that you have better control over the selected node after the deletion.

Proposed Solution
(z/remove zloc z/left) selects the left sibling node after removing the current node.
(z/remove zloc z/right) selects the right sibling node after removing the current node.
(z/remove zloc z/prev) matches the current behavior.

Similar changes for z/remove* function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions