Fork me on GitHub
#cursive
<
2016-06-12
>
cjmurphy03:06:12

I'm sure that control shift slash is always how I've uncommented code. But now it is not working. Looking at my keymap it seems to be assigned to 'Comment with Block Comment'. And I can't see Uncomment anywhere. So looking at the configuration makes sense. Probably not related, but I have a question - how do you ensure that you are not receiving the absolutely latest Cursive changes? I remember on installing I elected to go for getting the latest updates, so would now like to know how to undo this.

cfleming03:06:12

@cjmurphy: Actually, “Comment with Block Comment” has never worked with Clojure, there’s an issue here: https://github.com/cursive-ide/cursive/issues/1047

cfleming03:06:32

The equivalent “Comment with Line Comment” does work.

cjmurphy03:06:00

Commenting works as usual, uncommenting doesn't.

cjmurphy03:06:38

My money is on its either my fault or Linux Mint's fault.

cfleming03:06:38

I just tried it, it definitely doesn’t work for me, and I would swear it’s never worked because I have never implemented that 🙂

cfleming03:06:51

So the block commenting for you adds a line comment?

cjmurphy03:06:02

Oh - so uncommenting has never worked?

cfleming03:06:21

They both work for line comments, neither has ever worked for block comments.

cjmurphy03:06:58

You highlight something that has lots of ; at the start of each line, and you can't just remove them with a keystrokes?

cfleming03:06:29

Yes, that’s “Comment with Line Comment"

cjmurphy03:06:46

I am only talking about uncommenting lots of lines that are already commented then.

cfleming03:06:04

That should work fine, but the command is not the block comment one.

cfleming03:06:51

For example, in Java/JS/C etc, that would comment and uncomment all the lines with //. Using the block comment commmand would use /* ... */

cjmurphy03:06:57

I'm used to commenting and uncommenting the //, and this carried over to the ;.

cfleming03:06:17

Right, that should work. If it does not, can you send an example?

cjmurphy03:06:05

Maybe I should try to find the keyboard shortcut in IDEA. Will it be called 'Uncomment with Line Comment'?

cfleming03:06:50

“Comment with Line Comment”, probably Ctrl-/

cfleming03:06:44

I think you want Ctrl-/

cjmurphy03:06:54

That works fine

cjmurphy03:06:21

OMG sorry you are right I am so dumb.

cfleming03:06:23

If you want to map that to Ctrl-Shift-/ you can do that in Settings-&gt;Keymap

cjmurphy03:06:32

It is a toggle.

cfleming03:06:53

Right - that’s how it works for Java as well

cfleming03:06:42

The one edge case there is if your selection contains some commented and some uncommented lines - in that case, it will comment them all, which means re-commenting the lines that are already commented.

cjmurphy03:06:46

Been doing it for years. I can only laugh

cfleming03:06:19

Hehe, no worries - that stuff gets down into the reptilian hindbrain, but gets erased from the conscious 🙂

cfleming03:06:38

I can never remember what the keystrokes are for things I do all day, unless I have a keyboard to actually do it on.

cjmurphy03:06:32

Yes thanks - sometimes when starting my brain just isn't there yet. Wow. Thanks. (EDIT: but never-the-less some update had trashed my existing keystroke settings, so it seems I smelt there was a problem 😛)

cfleming03:06:07

No problem!

wasser16:06:17

AFK, but I think it even works for stuff like HTML.

joshg20:06:26

Is it possible to force Cursive to reindex without closing and reopening the project? This seems to be required to get Cursive to recognize new imports.

danielcompton20:06:10

@joshg: what do you mean when you say imports? Java imports in an ns, or new deps in project.clj?

joshg20:06:22

Java imports, although come to think of it, it’s probably due to adding a new dependency to project.clj. Is there a way to reindex without closing and reopening the project?

joshg20:06:50

Running lein deps or restarting the repl doesn’t seem to be enough.

ckarlsen21:06:47

'refresh leiningen projects'?

joshg21:06:44

ckarlsen: I didn’t know that existed, but seems to have worked. Thanks!

danielcompton21:06:53

@joshg https://github.com/cursive-ide/cursive/issues/56 you can watch that issue for improvements to Lein syncing

joshg21:06:01

danielcompton: that would be a convenient feature, thanks

cfleming21:06:41

I’m planning to do #1433 rather than #56, BTW, because it’s very difficult to detect when edits to a project.clj are done and it’s in a valid state.