Skip to content
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

paredit/join removes comments when joining strings #351

Closed
lread opened this issue Feb 17, 2025 · 0 comments · Fixed by #356
Closed

paredit/join removes comments when joining strings #351

lread opened this issue Feb 17, 2025 · 0 comments · Fixed by #356

Comments

@lread
Copy link
Collaborator

lread commented Feb 17, 2025

Version
1.1.49

Platform
All

Symptom
paredit/join is deleting comments when they lie between the two strings to be joined.

Reproduction

(-> "(\"Hello \" ;; comment\n\"World\")"
    z/of-string
    z/down
    z/right
    pe/join
    ((juxt z/string z/root-string)))

Actual behavior

;; => ["\"Hello World\"" "(\"Hello World\")"]

Thoughts
Option 1: no-op because we don't really have 2 strings next to each other

Option 2: push out comment like so:

"(\"Hello World\" ;; comment\n)"

Joining by sequence does allow for comments between the seqs and preserves the comment...

(-> "(32) ;; comment\n(44)"
    z/of-string
    z/right
    pe/join
    ((juxt z/string z/root-string)))
;; => ["44" "[32 ;; comment\n44]"]

So I think I'll go for option 2.

Expected behavior

;; => ["\"Hello World\"" "(\"Hello World\" ;; comment\n)"]

Action
I'll handle.

lread added a commit that referenced this issue Feb 18, 2025
- rewritten to not use internal `global-find-by-node`
(contributes to #256)
- now takes type of left sequence (closes #321)
- no longer removes comments between strings when joining 2
strings (closes #351)
@lread lread closed this as completed in e8ff5fd Feb 18, 2025
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

Successfully merging a pull request may close this issue.

1 participant