Skip to content

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

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

Open
lread opened this issue Feb 15, 2025 · 0 comments
Open

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

lread opened this issue Feb 15, 2025 · 0 comments

Comments

@lread
Copy link
Collaborator

lread commented Feb 15, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant