Martin Pitt wrote:
> I often edit Python source code with long '''-style strings.
> Sometimes, vim gets confused about what is a string and what is code.
> For example, if you open this file with vim 7.1 (without a .vimrc)
> 
>   http://people.ubuntu.com/~pitti/tmp/vim-python-highlighting.py
> 
> and then do
>   :syntax enable
>   /TestUi
> 
> you'll land at the start of the "TestUI" class definition where the
> entire code is shown as a string, and the actual strings are shown as
> code.
> 
> After some scrolling, vim catches itself and displays it correctly
> again, but it is pretty confusing.
> 
> Any idea how to fix this? Thanks in advance!

See

:help :syn-sync

The most accurate/foolproof is to do

:syntax sync fromstart

but there are a number of other alternatives you can learn about in the above 
help 
section.

Of course, you need to put whichever command you choose to use in an 
appropriate 
place, which is probably ~/.vim/after/syntax/python.vim

Hope this helps,

Cheers,

Ben.




Send instant messages to your online friends http://au.messenger.yahoo.com 


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui