[TxMt] Serious bug with Python syntax highlighting

Rob Shearer textmate at v.cx
Tue Feb 6 12:24:50 UTC 2007


This is a known issue, is in the bug database (several times), and  
has been fixed in the latest version of the Python bundle. Update  
from subversion and the issue will go away.

(There are much much simpler examples that cause this to happen...)

I've got to say that if there's one "feature" I want in 2.0 it's an  
architecture that doesn't allow bundle bugs to hang the whole app,  
potentially losing any unsaved work.

On 6 Feb 2007, at 11:16, Nicolas Weber wrote:

> Hi,
>
> I've stumbled on a problem with TextMate's python handling which  
> goes into an infinite loop (or a really long computation) during  
> certain circumstances. When this happens, TextMate doesn't react to  
> any input anymore, which causes dataloss of everything typed after  
> the last save.
>
> I have the following function (<> only shows the position of the  
> caret and is no text) in a python file:
>
> def c(docstring, baseindent=0):
>   #from http://www.python.org/dev/peps/pep-0257/
>   lines = docstring.splitlines()
>   # Determine minimum indentation (first line doesn't count):
>   indent = sys.maxint
>   for line in lines[1:]:
>     stripped = line.lstrip()
>     if stripped:
>       indent = min(indent, len(line) - len(stripped))
>   # Remove indentation (first line is special):
>   trimmed = [<>lines[0].strip()]
>   if indent < sys.maxint:
>     indent -= baseindent
>     for line in lines[1:]:
>       trimmed.append(line[indent:].rstrip())
>   # Return a single string:
>   return '\n'.join(trimmed)
>
> Now I type ]<enter> and watch TextMate die. It'd be cool if this  
> could be fixed.
>
> To reproduce the problem:
> 1. Open TextMate
> 2. Paste the above function into TextMate, put your caret where <>  
> is (and remove <> from the text)
> 3. Go into python mode (shift-ctrl-opt-p 4)
> 4. enter ]<cr>
>
>
> Bye,
> Nico
>
> ______________________________________________________________________
> 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