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

Drag sexp forward/backward works unexpectedly when ignore forms are adjacent to form the command is called on #2164

Open
bpringe opened this issue Apr 19, 2023 · 4 comments
Labels
paredit Paredit and structural editing

Comments

@bpringe
Copy link
Member

bpringe commented Apr 19, 2023

Case 1

#_hello
(:hello world)| 

Drag sexp backwards

#_(:hello world)
hello

The same seems to happen in reverse with the above case (using drag sexp forwards with (:hello world) at the top).

Case 2

#_{:clj-kondo/ignore [:unresolved-symbol]}
(:hello world)|

Drag sexp backwards

(:hello world){:clj-kondo/ignore [:unresolved-symbol]}
#_

Case 3

(:hello world)
#_{:clj-kondo/ignore [:unresolved-symbol]}|

Drag sexp backwards

(:hello world)
{:clj-kondo/ignore [:unresolved-symbol]}#_
@bpringe bpringe added the paredit Paredit and structural editing label Apr 19, 2023
@bpringe
Copy link
Member Author

bpringe commented Apr 19, 2023

I was thinking that maybe it's hard to treat the #_ as part of the form it follows, since you can also use many #_s before a single form to ignore many. Case 1 acts as though #_ is its own form, which could make sense given what was just mentioned, but case 2 and 3 are still odd.

@PEZ
Copy link
Collaborator

PEZ commented Apr 19, 2023

Thanks! Looks weird indeed, and is tricky indeed. Essentially I have been thinking about it like you do there: as if #_ is its own form. So Case 1 is expected, even if maybe not optimal.

@PEZ
Copy link
Collaborator

PEZ commented Apr 19, 2023

Case 3 is fine if #_ is considered its own form, isn't it?

@bpringe
Copy link
Member Author

bpringe commented Apr 20, 2023

Ah, you're right! I didn't realize that before.

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

No branches or pull requests

2 participants