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

Request: config to use two semicolons ;; for line comments #1983

Closed
eggsyntax opened this issue Apr 26, 2018 · 10 comments
Closed

Request: config to use two semicolons ;; for line comments #1983

eggsyntax opened this issue Apr 26, 2018 · 10 comments
Labels
new Marks issues describing new features released Marks issues which have had the fixes released in a stable build
Milestone

Comments

@eggsyntax
Copy link

eggsyntax commented Apr 26, 2018

Since Emacs (and I believe some other editors) heavily indent single-semicolon line comments, and since the Clojure style guide advocates using two semicolons for line comments, using a single semicolon for line comments leads to inconsistency and conflict on multiple-editor teams. My team ends up with a lot of whitespace noise in commits, as Cursive indents single-semicolon line comments one way, and then Emacs reindents them a different way, and then Cursive reindents them again... It would be really nice if there were a config option to cause Comment line (and any other parts of Cursive that create line comments) to use the double semicolon.

@bbatsov
Copy link

bbatsov commented Apr 27, 2018

FWIW - in Emacs if you're in the beginning of a line we'd insert a ;;, if you're somewhere else - it'd be ;. Seems like a reasonable default behaviour to me that ideally should be shared across all tools.

Here's a bit of "historical" context - https://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html (it's pretty much the same for every major Lisp dialect)

@cursive-ide cursive-ide added this to the 1.8.0-eap2 milestone Jul 17, 2018
@cursive-ide
Copy link
Owner

This is fixed for the next EAP build, controlled by config at Editor->General->Smart Keys->Clojure->Use ;; for line comments.

@eggsyntax
Copy link
Author

Thank you, Colin, you are a scholar and a gentleman!

@bbatsov
Copy link

bbatsov commented Jul 17, 2018

Indeed! Thanks, Colin!

@vemv
Copy link

vemv commented Jul 19, 2018

Quick question (not a Cursive user myself) - with this improvement, can users hit ; just once and see ;; inserted?

A colleague of mine uses that keystroke-saving as an argument to prefer ; over ;;, so it'd be handy if Cursive made it easy.

(My understanding is that this ticket is concerned with comment toggling, but not necessarily with how a ; keystroke is handled)

@cursive-ide
Copy link
Owner

This works by adjusting the "Comment with Line Comment" action, which will comment the current line or selected lines, unless they're all commented in which case it will uncomment them. That's the standard way by which line comments are added in IntelliJ.

If the user just types ;, there's no magic there for that - if they want two, they'll have to press ; twice. Inside a line, you'd usually use the ; key but you only ever want a single semicolon there anyway.

@arichiardi
Copy link

arichiardi commented Aug 2, 2018

Also have a question on behalf of a colleague on this.

We enabled the option but every time we comment, either with ; or ;;, the text gets aligned at the very right, with spaces in between. This seems to be a vanilla feature because he's just installed Cursive...

How can we choose our own alignment of the comment?

@cursive-ide
Copy link
Owner

@arichiardi Are you using the ; key to do this, or the Code->Comment with Line Comment action?

@arichiardi
Copy link

The ; directly

@introom
Copy link

introom commented Jan 31, 2020

is it possbile to add a space after the double colon, e.g.,
;; foobar
instead of
;;foobar

@cursive-ide cursive-ide added the new Marks issues describing new features label Sep 22, 2020
@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
new Marks issues describing new features released Marks issues which have had the fixes released in a stable build
Projects
None yet
Development

No branches or pull requests

6 participants