vanishing syntax highlighting problem

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

vanishing syntax highlighting problem

Hari Krishna Dara

For the last few days, I have been having a weird problem with syntax
highlighting. After using my vim session for a few hours/days, suddenly
the syntax highlighting stops working and even explicitly doing "syntax
off" followed by a "syntax on" doesn't work. The problem almost always
starts (or noticed) when a new buffer is loaded. If the new buffer is
loaded in a split window, the other window still shows the syntax
highlighting, but after a refresh even that clears up. Every time this
happens, I have to restart my vim session to fix the problem. The
filetype detections seems to be working fine. The problem might have
started because of some new plugin I addeed or changes that I did to
vimrc/my plugins (I didn't upgrade my vim for sometime), but how do I
debug this issue? What should I check for when this happens? Since the
problem is not reproducible, it is not easy to narrow down to a specific
plugin.

--
Thanks a lot,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
Reply | Threaded
Open this post in threaded view
|

Re: vanishing syntax highlighting problem

Tim Chase-2
> vimrc/my plugins (I didn't upgrade my vim for sometime), but
> how do I debug this issue? What should I check for when this
> happens? Since the problem is not reproducible, it is not easy
> to narrow down to a specific plugin.

Well, given that you describe that it seems to occur when editing
certain new buffers, do you know what sorts of filetype those get
registered as?  If they're some particular extension, or some key
first-line or something of the sort, you may be able to track
down from there.  I'd hate to subject you to using the "-u NONE"
settings for long durations (hey look, folks...I've learned to
drop the "-U NONE" :)  as the colors hurt my eyes :)

The next time you note it happening, take note what type of file
you're editing and see if you can tell how you entered it (did
you copy & paste?  just open it with ":e blah.foo"?  etc)  The
results of something like

        :set ft? syntax?

Additionally, does the file in question have a modeline at the
top or bottom to direct Vim to use some particular flavor of
filetype or syntax?

Sorry this isn't a "wham, here's your answer" but rather more of
a "here's a slightly better airbag for the next time you crash"
sorta answer, but it should get you a bit more in-flight
information when it happens next to try and diagnose it from there.

-tim



Reply | Threaded
Open this post in threaded view
|

Re: vanishing syntax highlighting problem

A.J.Mechelynck
In reply to this post by Hari Krishna Dara
----- Original Message -----
From: "Hari Krishna Dara" <[hidden email]>
To: <[hidden email]>
Sent: Monday, August 01, 2005 11:03 PM
Subject: vanishing syntax highlighting problem


>
> For the last few days, I have been having a weird problem with syntax
> highlighting. After using my vim session for a few hours/days, suddenly
> the syntax highlighting stops working and even explicitly doing "syntax
> off" followed by a "syntax on" doesn't work. The problem almost always
> starts (or noticed) when a new buffer is loaded. If the new buffer is
> loaded in a split window, the other window still shows the syntax
> highlighting, but after a refresh even that clears up. Every time this
> happens, I have to restart my vim session to fix the problem. The
> filetype detections seems to be working fine. The problem might have
> started because of some new plugin I addeed or changes that I did to
> vimrc/my plugins (I didn't upgrade my vim for sometime), but how do I
> debug this issue? What should I check for when this happens? Since the
> problem is not reproducible, it is not easy to narrow down to a specific
> plugin.
>
> --
> Thanks a lot,
> Hari

[ad banner snipped]

Next time it happens, try the following in the window which exhibits the
problem

    :verbose set filetype? syntax?
    :filetype
    :syntax

You might also check the bottom of the output of ":scriptnames" for the most
recently loaded scripts.

As of this writing, the most recent versions are 6.3.086 (stable) and
7.00aa.0121 (alpha, release date 2005 Jul 31). If your current version (as
shown in the firt few lines of the ":version" output) is much older than
that, you might consider upgrading.

I don't know if this will help you much, but it's all I can think of at the
moment.

Best regards,
Tony.


Reply | Threaded
Open this post in threaded view
|

Re: vanishing syntax highlighting problem

Hari Krishna Dara
In reply to this post by Hari Krishna Dara

On Mon, 1 Aug 2005 at 11:55pm, Tony Mechelynck wrote:

> ----- Original Message -----
> From: "Hari Krishna Dara" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, August 01, 2005 11:03 PM
> Subject: vanishing syntax highlighting problem
>
>
> >
> > For the last few days, I have been having a weird problem with syntax
> > highlighting. After using my vim session for a few hours/days, suddenly
> > the syntax highlighting stops working and even explicitly doing "syntax
> > off" followed by a "syntax on" doesn't work. The problem almost always
> > starts (or noticed) when a new buffer is loaded. If the new buffer is
> > loaded in a split window, the other window still shows the syntax
> > highlighting, but after a refresh even that clears up. Every time this
> > happens, I have to restart my vim session to fix the problem. The
> > filetype detections seems to be working fine. The problem might have
> > started because of some new plugin I addeed or changes that I did to
> > vimrc/my plugins (I didn't upgrade my vim for sometime), but how do I
> > debug this issue? What should I check for when this happens? Since the
> > problem is not reproducible, it is not easy to narrow down to a specific
> > plugin.
> >
> > --
> > Thanks a lot,
> > Hari
>
> [ad banner snipped]
>
> Next time it happens, try the following in the window which exhibits the
> problem
>
>     :verbose set filetype? syntax?
>     :filetype
>     :syntax
>
> You might also check the bottom of the output of ":scriptnames" for the most
> recently loaded scripts.

I will do that. I checked 'filetype' and it was set correctly.

>
> As of this writing, the most recent versions are 6.3.086 (stable) and
> 7.00aa.0121 (alpha, release date 2005 Jul 31). If your current version (as
> shown in the firt few lines of the ":version" output) is much older than
> that, you might consider upgrading.

I am using Vim 6.3 with patches 1-31. If I don't get a solution, I will
also try upgrading to patch level 86.

>
> I don't know if this will help you much, but it's all I can think of at the
> moment.

Thanks, I hope I can get more information next time.

>
> Best regards,
> Tony.


For Aaron, I am not using minibufexplorer.

--
Thanks,
Hari


               
__________________________________
Yahoo! Mail for Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail 
Reply | Threaded
Open this post in threaded view
|

Re: vanishing syntax highlighting problem

Hari Krishna Dara
In reply to this post by Hari Krishna Dara

On Mon, 1 Aug 2005 at 4:55pm, Tim Chase wrote:

> > vimrc/my plugins (I didn't upgrade my vim for sometime), but
> > how do I debug this issue? What should I check for when this
> > happens? Since the problem is not reproducible, it is not easy
> > to narrow down to a specific plugin.
>
> Well, given that you describe that it seems to occur when editing
> certain new buffers, do you know what sorts of filetype those get
> registered as?  If they're some particular extension, or some key
> first-line or something of the sort, you may be able to track
> down from there.  I'd hate to subject you to using the "-u NONE"
> settings for long durations (hey look, folks...I've learned to
> drop the "-U NONE" :)  as the colors hurt my eyes :)

Today when it happened, it was on a sql file, and the 'ft' was set as
expected. I am not sure if it was on sql files before. I can't use "-u
NONE" for a long time not only because it will be really hard to work
like that (I can't believe I said that as Vi used to be my only editor
before I discovered Vim, and Vim with "-u NONE" option is still several
orders better than Vi), but also because I don't know how long I have to
work like that to confirm anything. More over, I haven't changed my vim
version for a long time (file is dated 17-Nov-2004), and I have been
observing the problem only recently.

>
> The next time you note it happening, take note what type of file
> you're editing and see if you can tell how you entered it (did
> you copy & paste?  just open it with ":e blah.foo"?  etc)  The
> results of something like
>
> :set ft? syntax?
>

Yes, this time I first observed the problem when I opened up a file from
the grep results shown by my greputils.vim, so if it happens again I
will take a note and observe some pattern.

> Additionally, does the file in question have a modeline at the
> top or bottom to direct Vim to use some particular flavor of
> filetype or syntax?

No, there were no modelines.

>
> Sorry this isn't a "wham, here's your answer" but rather more of
> a "here's a slightly better airbag for the next time you crash"
> sorta answer, but it should get you a bit more in-flight
> information when it happens next to try and diagnose it from there.
>
> -tim

I understand, I had no clue on how to approach, and hopefully you folks
can help me go in the right direction.

--
Thanks,
Hari


               
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs 
 
Reply | Threaded
Open this post in threaded view
|

Re: vanishing syntax highlighting problem

Charles E Campbell Jr
In reply to this post by Hari Krishna Dara
Hari Krishna Dara wrote:

>For the last few days, I have been having a weird problem with syntax
>highlighting...
>
Hello, Hari!

May I throw another suggestion or two into the hat?

* have you made any recent changes to your <.vimrc>?
* have you recently added/upgraded any plugins/ftplugins/etc?

Do you have any backups of, say, a month ago when you weren't having
problems.
I suggest restoring from your backups (assuming you have any): .vimrc
and the .vim/
directory tree.  Move your current .vimrc and .vim to something safe
first, like
DOTVIMRC and DOTVIM.

Do your usual editing and see if your problem recurs.  If it doesn't,
then look for
changes (use vimdiff, diff, cmp, etc).

If it does, then use an even older backup :) .  I would also suggest
that you upgrade
your vim, just in case some patch has already fixed whatever is ailing you.

Regards, and good luck!
Chip Campbell