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

Be (optionally) able to skip map alignment by inserting blank lines #2026

Closed
vemv opened this issue Aug 10, 2018 · 2 comments
Closed

Be (optionally) able to skip map alignment by inserting blank lines #2026

vemv opened this issue Aug 10, 2018 · 2 comments
Labels
changed Marks issues describing changes to existing features released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@vemv
Copy link

vemv commented Aug 10, 2018

clojure-mode intentionally supports that behavior clojure-emacs/clojure-mode#481 (comment) , so it'd be good that Cursive did too:

  • for avoiding discrepancies;
  • and also it's a quite desirable feature. Map alignment for e.g. project.clj is rather meaningless and it makes it more difficult to meet a max column length (like 80).

Thanks - Victor

@cursive-ide
Copy link
Owner

I've asked over on the clojure-mode issue what the logic is there so I can figure out how hard this would be to implement.

@vemv
Copy link
Author

vemv commented Sep 25, 2018

In that thread you asked:

How does this work? What is the logic that's applied?

Now that the issue has been closed clojure-emacs/clojure-mode@9127dc4 , I can more confidently say:

clojure-mode doesn't have a fine-grained/custom logic for this. Emacs has the align-region built-in command, which docstring you can query here:

https://github.com/emacs-mirror/emacs/blob/d0c77a189423dbf648ca5ae9d831a5a2e04e6947/lisp/align.el#L1273

So the working is basically:

  • determine a region (selection) from sexp-beginning to sexp-end (e.g from line-1-column-4 to line-2-column-9)
  • invoke align-region to with those parameters
  • if align-region finds a blank line (or more specifically: a line matching a user-supplied regex), it does nothing.

Hope it helps!

@cursive-ide cursive-ide added this to the 1.11.1 milestone Oct 6, 2021
@cursive-ide cursive-ide added the changed Marks issues describing changes to existing features label Oct 24, 2021
@cursive-ide cursive-ide modified the milestones: 1.12.0, 1.12.0-eap1 Oct 25, 2021
@cursive-ide cursive-ide added the released Marks issues which have had the fixes released in a stable build label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changed Marks issues describing changes to existing features released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

2 participants