Search the web
Sign In
New User? Sign Up
vimdev · Vim (Vi IMproved) text editor developers list
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Click here for the latest updates on Groups Message search

Messages

  Messages Help
Advanced
Problem with 'hidden' and :bufdo   Topic List   < Prev Topic  |  Next Topic >
Reply < Prev Message  | 

Hi all,

 

I’ve had some occasions where I’ve been editing multiple files at once, and for some reason some of the files did not get syntax highlighting turned on.  I could never really pinpoint the circumstances until today when I decided to use a binary search approach to track down what it might be.

 

The problem occurs with 7.2.293 that I’ve compiled as well as stock 7.2 with the following 3-line .vimrc:

set hidden

filetype on

syntax on

 

And then invoke Vim as follows in a directory that has several .c files (it seems you could use any :bufdo command here, this is just an example):

vim -c “bufdo normal gg” *.c

 

The problem I see is that the first and last buffers have syntax highlighting, but all the intermediate buffers do not.  For example, if there are 10 .c files, then only buffers 1 and 10 will have syntax highlighting.

 

There are several different components interacting in this scenario, so I’m not sure which are actually necessary to cause the problem, and which are just there to expose the problem.  I suspect the problem may be in the interaction between ‘hidden’ and :bufdo, since both of those involve buffers.

 

Craig

 

P.S.  I actually don’t remember why I set ‘hidden’ in my .vimrc, it’s just been that way for so long!

 


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



Wed Nov 25, 2009 1:49 am

craigba@...
Send Email Send Email

< Prev Message  | 
Expand Messages Author Sort by Date

Hi all, I've had some occasions where I've been editing multiple files at once, and for some reason some of the files did not get syntax highlighting turned...
Craig Barkhouse
craigba@...
Send Email
Nov 25, 2009
1:52 am

... At ':help :bufdo' we see that bufdo disables the Syntax automcommand event (for speed). That means the buffers you had not previously visited do not have...
John Beckett
johnb.beckett@...
Send Email
Nov 25, 2009
6:10 am

... When issuing :bufdo, the Syntax autocommand event is added to the 'eventignore' option, so that bufdo can perform faster. This is described at :h :bufdo If...
Christian Brabandt
cblists@...
Send Email
Nov 25, 2009
6:39 am

... Thanks Christian (and John Beckett) for the explanation. This still doesn't quite explain the interaction with 'hidden'. If I comment out the "set hidden"...
Craig Barkhouse
craigba@...
Send Email
Nov 25, 2009
6:25 pm
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help