On Sunday, July 28, 2019 at 4:03:37 PM UTC-5, Edward K. Ream wrote: > black looks considerably slower than Leo's beautify commands.
On second thought, it looks like Leo *can* use black with very little extra work. *Black looks fast enough* The blacken-node command (in the "black" branch) takes about 0.01 sec for typically sized nodes. At present, this code doesn't actually change p.b. It only reports diffs. So it looks like Leo could optionally run blacken-node whenever selecting and/or unselecting a node for which @language python is in effect. *Leonine constructs are not gotchas* black.make_chunks adapts black to Leo. It calls black only for sequences of lines *not *containing Leonine constructs. At present, it doesn't recognize @language so as to call black only for sequences of python lines. Black's (mis-) handling of Leo's sentinel lines doesn't matter because sentinel lines never appear in p.b. We might add an @no-black directive, or maybe even retire the @no-beautify directive. *Summary* Leo could (optionally) run the blacken-node command when selecting nodes containing python source code. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/9eaa4734-daeb-420a-9663-4b991e4d1dee%40googlegroups.com.
