Fork me on GitHub
#parinfer
<
2018-02-15
>
cfleming22:02:18

@shaunlebron I’m looking at the thing we talked about the other day, where in Atom having a selection means that smart mode is disabled.

cfleming22:02:00

This is tricky again in IntelliJ because of the many-many mapping between editors and documents.

cfleming22:02:26

I’m thinking about disabling smart mode for processing a particular document, when any editor looking at that document has a selection.

cfleming22:02:59

Either that, or just not implementing that feature, and then the user would have to indent the lines they want and then outdent the following lines.

cfleming22:02:16

Which isn’t ideal, but is at least predictable in tricky cases.

cfleming22:02:53

Any opinions?

shaunlebron22:02:29

yeah, I don’t think there’s an ideal solution for intellij then

shaunlebron22:02:03

when a selection is made, it’s hypothetically nice to fallback to indent mode

shaunlebron22:02:19

so maybe exposing that as a mode?

shaunlebron22:02:29

i don’t like that idea either honestly

shaunlebron22:02:01

might be best to look at actual problem cases and go from there

cfleming21:02:41

I actually have dedicated indent/dedent actions for indenting/dedenting lines. I think the best solution is for those to adjust the parens as part of the action itself.

cfleming21:02:18

That should cover all cases I can think of, since indenting/dedenting with space/backspace can’t work with the selection active.

shaunlebron21:02:10

i’m not following, an example would help

cfleming21:02:16

So the cases that require this handling are basically indenting and dedenting selected lines, per the last example in your video.

cfleming21:02:53

In Cursive, that indenting and dedenting use custom actions that I wrote, since they handle the indenting to indent points.

cfleming21:02:58

What I can do is just move the parens around as in indent mode as part of those actions, that will effectively mean that those actions (and just those actions) will have the indent mode behaviour.

cfleming21:02:14

Does that make sense?

shaunlebron21:02:00

yeah that makes sense, so you’re binding indent/dedent actions to run indent mode instead of smart mode

shaunlebron21:02:14

so indent/dedent commands run indent mode, but space/delete runs smart mode

cfleming21:02:17

Something like that - either I can check the last executed action, or I can explicitly run indent mode as part of the action itself.