Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

custom color syntax goes away after deleting a buffer #24

Closed
chrismcbride opened this Issue Sep 7, 2011 · 25 comments

Comments

Projects
None yet
5 participants

I have a few custom color highlights in my .vimrc, whenever I close a buffer I lose them, I have to restart vim to get them back, I'm using gvim version 7.2. I have the latest version from github and I've tried setting the flag to force the color syntax reload.

Owner

fholgado commented Sep 7, 2011

Hi Chris,

I'm aware of the issue. Had a chance to work on MBE a bit this past weekend and I think I'll have some more time this weekend. Should be able to get out a new release that fixes it! Let me know if you run into anything else.

Federico

On Wednesday, September 7, 2011 at 2:41 PM, chrismcbride wrote:

I have a few custom color highlights in my .vimrc, whenever I close a buffer I lose them, I have to restart vim to get them back, I'm using gvim version 7.2. I have the latest version from github and I've tried setting the flag to force the color syntax reload.

Reply to this email directly or view it on GitHub:
#24

thanks, I appreciate the quick response!

On Wed, Sep 7, 2011 at 2:43 PM, Federico Holgado <
reply@reply.github.com>wrote:

Hi Chris,

I'm aware of the issue. Had a chance to work on MBE a bit this past weekend
and I think I'll have some more time this weekend. Should be able to get out
a new release that fixes it! Let me know if you run into anything else.

Federico

On Wednesday, September 7, 2011 at 2:41 PM, chrismcbride wrote:

I have a few custom color highlights in my .vimrc, whenever I close a
buffer I lose them, I have to restart vim to get them back, I'm using gvim
version 7.2. I have the latest version from github and I've tried setting
the flag to force the color syntax reload.

Reply to this email directly or view it on GitHub:
#24

Reply to this email directly or view it on GitHub:
#24 (comment)

Contributor

toupeira commented Oct 19, 2011

Hey Federico,

Looks like removing the call to syntax enable on line 1604 does the trick, and I'm not sure why it was needed in the first place. Maybe to be safe you could just wrap it in a check for g:miniBufExplForceSyntaxEnable (which I've already set to 0) as on line 1660?

Owner

fholgado commented Oct 19, 2011

Hey Toupeira,

Glad you figured this out. It's been driving me nuts for a while. I have been slammed at a new job, but I should be able to make this change and push it out sometime within the next day or so. Still have a bunch of stuff to fix, but this was the biggest immediate issue by far.

Thanks again!

Contributor

toupeira commented Oct 19, 2011

No problem, thanks to you for still maintaining MBE ;-) To make it easier for you I've created a fork and sent you a pull request. This is the first time I'm doing this, so I hope I did it correctly!

@fholgado fholgado added a commit that referenced this issue Oct 20, 2011

@fholgado fholgado Merge pull request #27 from toupeira/master
Issue #24 - Fix syntax highlighting break when closing buffers.
c2f5ba6
Owner

fholgado commented Oct 20, 2011

Guys, this has been fixed and updated. Feel free to reopen if the issue persists. Thanks again for the help :)

@fholgado fholgado closed this Oct 20, 2011

Now I get this error every time I open a new buffer

Error detected while processing function 15_AutoUpdate..15_StartExplorer:
line 58:
E518: Unknown option: colorcolumn&

Owner

fholgado commented Oct 21, 2011

Chris, what version of Vim are you using? Seems to work OK for me in Vim 7.3.

I'm on Vim 7.2, the debian package

Contributor

toupeira commented Oct 21, 2011

Hey Chris, it seems to work fine here with Vim 7.2 on OS X, and Vim 7.3 on OS X and Debian. There's no mention of "colorcolumn" in either the MBE source or the Vim runtime files, so maybe you have a local modification that's causing this?

Hmm...Ok I'll look in to it on my end

On Fri, Oct 21, 2011 at 7:29 AM, Markus Koller <
reply@reply.github.com>wrote:

Hey Chris, it seems to work fine here with Vim 7.2 on OS X, and Vim 7.3 on
OS X and Debian. There's no mention of "colorcolumn" in either the MBE
source or the Vim runtime files, so maybe you have a local modification
that's causing this?

Reply to this email directly or view it on GitHub:
#24 (comment)

On line 753 on minibufexpl.vim it has the command "setlocal colorcolumn&". I commented that out and the error went away. I'm not sure what it does.

Contributor

toupeira commented Oct 21, 2011

Looks like a new feature from Vim 7.3 that highlights one ore more columns, nice ;-)

Owner

fholgado commented Oct 21, 2011

Ah... I'll wrap it in a conditional to only check if you're in Vim > 7.3. Sorry about that!

@fholgado fholgado reopened this Oct 21, 2011

you could also do this

if has('colorcolumn')
setlocal colorcolumn&
endif

On Fri, Oct 21, 2011 at 12:16 PM, Federico Holgado <
reply@reply.github.com>wrote:

Ah... I'll wrap it in a conditional to only check if you're in Vim > 7.3.
Sorry about that!

Reply to this email directly or view it on GitHub:
#24 (comment)

Contributor

toupeira commented Oct 21, 2011

Ah whoops, I completely forgot I'm using my own MBE fork now where I didn't merge the colorcolumn change yet ;-)

Sorry for the confusion Chris!

Haha its no problem. It was a pretty easy fix

On Fri, Oct 21, 2011 at 12:54 PM, Markus Koller <
reply@reply.github.com>wrote:

Ah whoops, I completely forgot I'm using my own MBE fork now where I didn't
merge the colorcolumn change yet ;-)

Sorry for the confusion Chris!

Reply to this email directly or view it on GitHub:
#24 (comment)

In the latest version (74e8194), syntax coloring disappears after doing the following:

  1. export TERM=xterm-256color
  2. start vim with 2 buffers (both c syntax)
  3. :b2
  4. :bd
    Now the syntax of the first buffer is not highlighted anymore, I have to enable syntax manually by typing 'syntax enable'.
Contributor

toupeira commented Dec 12, 2011

Seems to work fine here with 74e8194 and the following settings:

let g:miniBufExplSplitBelow = 0
let g:miniBufExplForceSyntaxEnable = 0
let g:miniBufExplMapCTabSwitchBufs = 1
let g:miniBufExplMapWindowNavVim = 1
let g:miniBufExplMapWindowNavArrows = 1
let g:miniBufExplMaxSize = 0
let g:miniBufExplModSelTarget = 1
let g:miniBufExplTabWrap = 1
let g:miniBufExplUseSingleClick = 1
let g:miniBufExplCheckDupeBufs = 0

Ahh, my bad I think. In step 4), I accidentally executed :q instead of :bd. The :q command closes MBE and that disables the syntax. I'm not sure if this is a bug or correct behavior though. Two possible solutions come into mind: either close vim (act as if MBE wasn't there) or reenable syntax. Is this possible? Or is there any workaround?

Contributor

toupeira commented Dec 13, 2011

:q doesn't reset the syntax here either (though it does correctly close MBE). Try setting g:miniBufExplForceSyntaxEnable = 0, I used to have this enabled and IIRC it caused similar problems.

Ok, this is really weird. I disabled pathogen, all plugins, commented out all the vimrc settings. All that's left is the MBE settings toupeira suggested above and only MBE plugin enabled. I start vim with two C-syntax buffers, type :q, MBE closes and syntax highlighting is gone. I also tried different terminals and colorschemes. Is it just me who's having this issue?:(

Contributor

toupeira commented Dec 13, 2011

What Vim version are you using? I've tried with both 7.3.346 on Linux and 7.3.353 on OS X, but couldn't reproduce your problem.

You might find out more by enabling MBE's debug output, check the help for instructions.

I'm using vim 7.3.315 (Fedora 16 latest packages) but it doesn't seem to matter. I also tried compiling vim from the latest mercurial and the behavior is the same. If I start editing the file, MBE automatically opens again and syntax resets. But if I just want to read through the file (which is almost always what I want to do), I have to enable it manually as mentioned above. Here is the debug output I got:

0:10:-=> BufEnter AutoCmd
1:10:===========================
2:10:Entering AutoUpdate(-1) : 1 : main.cpp
3:10:===========================
4:9:AutoUpdates are turned off, terminating
5:10:===========================
6:10:Completed AutoUpdate()
7:10:===========================
8:10:-=> BufEnter Checking for Last window
9:10:-=> VimEnter AutoCmd
10:10:===========================
11:10:Entering AutoUpdate(-1) : 1 : main.cpp
12:10:===========================
13:10:Entering HasEligibleBuffers()
14:6:More Than One mode turned on
15:6:HasEligibleBuffers found 2 eligible buffers of 2 needed
16:9:About to call StartExplorer (Create MBE)
17:10:===========================
18:10:Entering StartExplorer()
19:10:===========================
20:10:Entering FindCreateWindow(-MiniBufExplorer-)
21:10:Entering FindWindow()
22:10:Entering FindWindow()
23:9:Found buffer (-MiniBufExplorer-): 4
24:9:Created and then found window (-MiniBufExplorer-): 1
25:9:Window (-MiniBufExplorer-) created: 1
26:10:Entering DisplayBuffers()
27:10:Entering ShowBuffers()
28:10:Entering BuildBufferList()
29:10:l:i is 1 and l:CurrBufName is main.cpp
30:10:l:i is 2 and l:CurrBufName is main.cpp
31:10:l:i is 3 and l:CurrBufName is main.cpp
32:10:Entering ResizeWindow()
33:9:ResizeWindow to 1 lines
34:10:-=> BufDelete AutoCmd
35:10:===========================
36:10:Entering AutoUpdate(4) : 4 : -MiniBufExplorer-
37:10:===========================
38:9:AutoUpdate recursion stopped
39:10:===========================
40:10:Terminated AutoUpdate()
41:10:===========================
42:10:-=> BufDelete ModTrackingListClean AutoCmd for buffer 4
43:10:===========================
44:10:Completed StartExplorer()
45:10:===========================
46:10:===========================
47:10:Completed AutoUpdate()
48:10:===========================
49:10:-=> CursroHold AutoCmd
50:10:Buffer List is [1, 0]
51:10:-=> BufEnter AutoCmd
52:10:===========================
53:10:Entering AutoUpdate(-1) : 3 : MiniBufExplorer.DBG
54:10:===========================
55:10:Entering HasEligibleBuffers()
56:6:More Than One mode turned on
57:6:HasEligibleBuffers found 2 eligible buffers of 2 needed
58:10:Entering BuildBufferList()
59:10:l:i is 1 and l:CurrBufName is 3
60:10:l:i is 2 and l:CurrBufName is 3
61:10:l:i is 3 and l:CurrBufName is 3
62:9:About to call StartExplorer (Update MBE)
63:10:===========================
64:10:Entering StartExplorer()
65:10:===========================
66:10:Entering FindCreateWindow(-MiniBufExplorer-)
67:10:Entering FindWindow()
68:9:Found buffer (-MiniBufExplorer-): 4
69:9:Found window (-MiniBufExplorer-): 1
70:10:Entering DisplayBuffers()
71:10:Entering ShowBuffers()
72:10:Entering BuildBufferList()
73:10:l:i is 1 and l:CurrBufName is 3
74:10:l:i is 2 and l:CurrBufName is 3
75:10:l:i is 3 and l:CurrBufName is 3
76:10:Entering ResizeWindow()
77:9:ResizeWindow to 1 lines
78:10:===========================
79:10:Completed StartExplorer()
80:10:===========================
81:10:===========================
82:10:Completed AutoUpdate()
83:10:===========================
84:10:-=> BufEnter Checking for Last window
85:10:-=> CursroHold AutoCmd
86:10:Buffer List is [1, 0] [3, 0]
Collaborator

weynhamz commented Nov 23, 2012

Hey, I am closing this issue, because I believe it has been fixed in the develop branch of my fork and will soon be avaliable in @fholgado's repo in the coming relase 6.5. If the problem still remains, feel free to reopen it.

@weynhamz weynhamz closed this Nov 23, 2012

@weynhamz weynhamz was assigned May 10, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment