@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.
This is tricky again in IntelliJ because of the many-many mapping between editors and documents.
I’m thinking about disabling smart mode for processing a particular document, when any editor looking at that document has a selection.
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.
Which isn’t ideal, but is at least predictable in tricky cases.
Any opinions?
yeah, I don’t think there’s an ideal solution for intellij then
when a selection is made, it’s hypothetically nice to fallback to indent mode
so maybe exposing that as a mode?
i don’t like that idea either honestly
might be best to look at actual problem cases and go from there
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.
That should cover all cases I can think of, since indenting/dedenting with space/backspace can’t work with the selection active.
i’m not following, an example would help
So the cases that require this handling are basically indenting and dedenting selected lines, per the last example in your video.
In Cursive, that indenting and dedenting use custom actions that I wrote, since they handle the indenting to indent points.
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.
Does that make sense?
yeah that makes sense, so you’re binding indent/dedent actions to run indent mode instead of smart mode
so indent/dedent commands run indent mode, but space/delete runs smart mode
Something like that - either I can check the last executed action, or I can explicitly run indent mode as part of the action itself.