@cfleming i'm not actually running paren mode. it just happens to behave a bit like it. i'm using the work i previously did to figure out what the "correct" indentation is for a given line based on the tools.reader info. after every key press, i look at the subsequent lines. if they are not at their "correct" indentation level, i fix them.
the code doing that is all in cross-parinfer's add-indent
function, which is pretty garbage and hard to read right now
@sekao Interesting, thanks. Is that code somewhere I can take a look at?
You’re basically just correcting indentation on the form surrounding the current change, is that correct?
here's the function. apologies in advance for the eye bleed 😄 https://github.com/oakes/cross-parinfer/blob/master/src/cross_parinfer/core.cljc#L89
i plan on refactoring soon but the readme actually mentions how to use what i call :normal
mode
I see, interesting. Are you using it? Does it work well in practice?
I guess you adjust the indentation before running indent mode, right?
yes
you can try it here http://oakes.github.io/paren-soup/
i haven't really tested it enough so there could still be problems
the one case where it doesn't work is when typing an open delimiter to wrap existing code. that still requires manual re-indentation
@sekao I met a wired behavior, I delete all content in the first textarea
, then I input the following content:
(defn hello [name]
(print "hell
Before I close the string quote, textarea will append one empty line at end for each character I typed in the string.ah good catch, i'll check it out
thanks @doglooksgood i fixed the issue. if you do a force refresh on that page it should no longer have that behavior