Fork me on GitHub
#cursive
<
2021-02-15
>
armed07:02:18

Hi, is there any way to bind REPL to Idea workspace on branch switching? I work on master and dev branches and each have separate launched local/remote REPLs. Sometimes I forget to focus on specific REPL tab and send code from e.g. master to dev and vice versa.

serioga07:02:35

I would make two separate working copies / idea projects to work with branches without switching :-)

armed08:02:39

Maybe I should try that workflow thanks for suggestion. Anyway Idea already has workspaces and linking workspace to REPL seems reasonable feature for Cursive.

cfleming23:02:58

If I understand correctly, you’d like the active REPL to be recorded as part of the workspace, is that correct? So that when a workspace is restored, which REPL is active might get changed?

armed13:02:49

Hi, @U0567Q30W, yes that what I was thinking. Thanks for great plugin, by the way.

Jeff Evans17:02:50

Is there a way to make auto-formatting only touch lines I’m actively editing? Editing the bottom of a file still results in some stuff near the top (untouched) being reformatted. I presume it’s tied in with structural editing, since if I turn that off, then this behavior stops.

katox17:02:59

I don't think it is related to structural editing. Java code behaves the same. You can select the block explicitly though. Then it won't touch anything else.

Jeff Evans17:02:36

To be clear, I’m not referring to an active Edit/Reformat operation or anything like that.

Jeff Evans17:02:27

It’s an active editor window aggressively doing it even with no typing. Ex: I use the Git commit window to try to roll back the superfluous change (with the “revert” arrow), and the editor immediately undoes that again.

Jeff Evans17:02:30

Unless I disable structural editing, in which case that reversion sticks.

dpsutton17:02:59

> There’s a better way: we can use ⌥⇧⌘L or Ctrl+Alt+Shift+L, to bring up the reformatting options. We can say we only want to format the lines of the file that have been changed, and leave everything else alone. Now when the file is formatted, it only changes the lines that we’ve touched and nothing else

Jeff Evans18:02:03

yeah, I was positive I had that option enabled. but in any case, trying it now shows that only “Whole file” is enabled. the others can’t be selected, weirdly

dpsutton18:02:38

are you using parinfer or paredit?

Jeff Evans18:02:45

I guess they become active if there is VCS changed text, which makes sense

Jeff Evans18:02:02

but that just underscores that whatever is happening, happens even to unchanged lines 🤷:skin-tone-2:

Jeff Evans18:02:09

parinfer at the moment

dpsutton18:02:41

i think that might be the cause of it. it uses indentation semantically which is terrible. and the only way for it to work is to make sure everything is "right"

Jeff Evans18:02:42

it’s actually initialize! in driver.clj that it keeps happening to 😉

dpsutton18:02:54

if you switch to paredit i suspect you might have more luck?

Jeff Evans18:02:17

I may try that. I’m still noodling between the two to figure out which one gels more

cfleming23:02:56

Paredit (edit: I mean parinfer, ugh) is very nice, but it does require the whole file to be formatted at the moment. It should be possible to only require it per top-level-form, but I haven’t done that yet.

cfleming23:02:25

One thing to note is that parinfer will only modify the file once, once the indentation is consistent it then will only touch changed portions, as you’d expect. But that does require that all your code be formatted according to its (reasonable, IMO) requirements, which might not be feasible in teams where teammates are not using it.

dpsutton23:02:58

my use of the word terrible there was way harsh and out of line. the consistent formatting is a drawback but only if your codebase has a few drawbacks of its own. I didn't mean to come off like that and I apologize.

cfleming23:02:28

No worries! Formatting is something that raises strong opinions 🙂. Which is one reason that when I write the One Language To Rule Them All, it will have a gofmt-like thing from day one, and will probably refuse to compile if not formatted correctly 🙂