Skip to content

paredit/wrap-around returns nil if located on whitespace or comment #349

@lread

Description

@lread

Version
1.1.49

Platform
All

Symptom
If zipper is located on whitespace, wrap-around returns nil.

Reproduction

(-> "1\n2"
    z/of-string
    z/right*
    (pe/wrap-around :vector))

Actual behavior

;; => nil

Expected behavior
Let's see:

Option 1: No-op, return zloc unchanged.

Option 2: Wrap the whitespace node.
Don't think this in the spirit of paredit.

Option 3: Wrap the next non-ws/non-comment node else no-op.
This seems to match my doom emacs paredit.
But this means the location of the zipper moves, which can be surprising.
The user can always decide to locate to a non-ws non-comment node prior to wrap-around.

So, let's go for the least surprising/no-magic option 1, no-op:

;; => "1\n2"

Diagnosis
Done.

Action
I'll address.

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