cursive

Issues at: https://git.io/cursive-issues
armed 2021-02-15T07:04:18.160100Z

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.

armed 2021-02-15T08:10:39.160800Z

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

cfleming 2021-02-15T23:21:58.167100Z

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?

armed 2021-02-16T13:59:49.169200Z

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

serioga 2021-02-15T07:17:35.160200Z

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

2021-02-15T17:20:50.162900Z

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.

katox 2021-02-15T17:31:59.163Z

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.

2021-02-15T17:32:36.163200Z

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

2021-02-15T17:33:27.163400Z

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.

2021-02-15T17:33:30.163600Z

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

dpsutton 2021-02-15T17:33:59.163800Z

> 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

2021-02-15T18:21:03.164400Z

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

dpsutton 2021-02-15T18:21:38.164600Z

are you using parinfer or paredit?

2021-02-15T18:21:45.164800Z

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

2021-02-15T18:22:02.165Z

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

2021-02-15T18:22:09.165200Z

parinfer at the moment

dpsutton 2021-02-15T18:22:41.165400Z

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"

2021-02-15T18:22:42.165600Z

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

dpsutton 2021-02-15T18:22:54.165800Z

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

dpsutton 2021-02-15T18:22:56.166Z

ha

2021-02-15T18:23:17.166200Z

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

cfleming 2021-02-15T23:18:56.166700Z

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.

cfleming 2021-02-15T23:20:25.166900Z

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.

dpsutton 2021-02-15T23:45:58.167300Z

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.

cfleming 2021-02-15T23:59:28.167500Z

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 🙂