[TxMt] Re: First impressions

Yi Qiang yqiang at gmail.com
Wed Jan 30 04:52:39 UTC 2008


On Jan 29, 2008 3:35 PM, Jacob Rus <jacobolus at gmail.com> wrote:
> Konrad Hinsen wrote:
> > Python support is really disappointing. Folding is completely useless
> > (blocks end at the first blank line),
>
> This is an unfortunate side-effect of TextMate's current folding system
> which only allows foldings at matching indentation levels.  It will
> certainly change sometime in the hazy indefinite future of later TM
> versions.  In the mean time, as a workaround, if you get the whitespace
> just right, foldings work great (there's a Cleanup Whitespace command in
> the Python bundle which does this).  It's far from ideal, but it works
> for me.
>
Just another note, this command works fine for function definitions
that are not multiline.

e.g.,

def foo(bar):
    do something

will fold fine, but

def foo(bar1,
            bar2)

will not fold after cleaning up white space.

> > tabs are not handled in a
> > reasonable way (using hard tabs with an indentation other than 8 is an
> > invitation for disaster in Python code), leading to indentation errors,
>
> I've never seen python code which uses a mix of hard tabs and spaces;
> such is explicitly discouraged by every Python style guideline I've ever
> seen.  Pick either tabs or spaces and stick to it (you can set them with
> the little dropdown at the bottom of every window).  I personally prefer
> 4-space tabs (never using hard tab characters in my Python code), but
> code using only hard tabs should also work fine, as should 2-space tabs
> (e.g. Google's internal code, according to Guido), etc.
>
> > and the error output in PyMate is insufficient (I want the full traceback).
>
> The traceback should be close to identical to that you'd get in the
> regular Python shell.  Do you have an example where it differs
> significantly?
>
> > I looked a bit at the language definitions, and I have the impression
> > that reasonable folding for LaTeX and Python cannot be implemented in
> > TextMate, as the beginning and end of a block must be defined by a
> > regular expression matching a single line. Or did I overlook something?
>
> It can't be done for now.  So we just have to keep our fingers crossed
> for Allan's speedy progress. :)
>
> -Jacob
>
>
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
>



More information about the textmate mailing list