[TxMt] Re: Small Python annoyances

Julio Biason julio.biason at gmail.com
Fri Jun 20 00:44:35 UTC 2008


On Thu, Jun 19, 2008 at 8:37 PM, Hans-Joerg Bibiko <bibiko at eva.mpg.de> wrote:
> What do you mean with "but I still get the closing parenthesis and
> colon when I create a function ("def")" ?

On a Python source file, when I type "def function(" I get a "):" for free. ;)

It seems TextMate understand that it added the ")" automatically (so
it just skips it when I press ")"), but not the ":".

> If you type "def" and press TAB it inserts:

Well, I'm not using TAB in this case yet.

> Did you set up the doc to use "Soft Tabs"? (status bar > click on Tab
> size).
> Then TM does the job.

No, I didn't. Well, I just did and it works fine now. Thanks heaps!

> To do this automatically while writing could be a bit tricky.

I understand that. It's probably a pain to check strings and such, but
I guess doing it with any other command should be fine (Python knows
when to keep reading if you left an open bracket somewhere.)

Just to add some more information: Most of my source were edited on
Vim on a Linux box. Vim does the hard-breaking stuff, but gets
confused when you have a string (it actually breaks the string, which
doesn't work as one would expect.)

>> Fourth, PyCheckMate doesn't understand when you do an indentation when
>> you do a hard-break and add the indentation (it complains about
>> "unexpected indent".)
>
> Not for me. Could you please give an example.

Ok, that's totally my fault. It seems the code is using tabs and I
added the line breaks using spaces. "Show invisibles"  (as pointed by
Jay) shows that yes, I did mix spaces and tabs. Can you guys just
forgot that I mentioned that? ;)

-- 
Julio Biason <julio.biason at gmail.com>
Twitter: http://twitter.com/juliobiason



More information about the textmate mailing list