Intent to mark Ducktype 1.0 final
Shaun McCance
<shaunm at gnome.org>
Tue Apr 2 10:28:50 EDT 2019
- Next message: Ducktype 1.0
- Sort by: [ thread ] [ subject ] [ author ] [ date ]
On Sat, 2019-03-09 at 14:34 -0500, Shaun McCance wrote: > 2) I changed the indent trim rule for fences. Previously, a fence > would > trim indentation from its lines up to the indent level of its first > line. This made it impossible to jump in and out of fences in the > middle of indented code. > > [code] > def frobnicate() > [[[ > pass # This would be at the same indent as the def > ]]] > > I changed it to trim to the indent level of the starting [[[ marker. > I > think this is what most people would expect anyway. I still wasn't happy with this, so I'm again tweaking it a bit more. Since you don't need to indent content to stay in a fence, some people won't. Consider, for example, somebody just pasting some code in from somewhere else, and not reindenting it because Ducktype allows that. [code] [[[ def frobnicate(): pass ]]] With my change away from using the indent of the first line, every line here will have at most four spaces stripped, which is clearly wrong. At the same time, I want to keep the ability to indent the first line, as in the prior example. So, the solution is this: the indentation trim will be the minimum of the indent of the first line and the indent of the [[[ marker. I think this behavior will most closely match what most people will expect. -- Shaun
- Next message: Ducktype 1.0
- Sort by: [ thread ] [ subject ] [ author ] [ date ]
- More information on mallard-list