Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColorToggle doesn't enable color when previously toggled in another file #23

Closed
moll opened this issue Jul 29, 2013 · 4 comments
Closed

Comments

@moll
Copy link

moll commented Jul 29, 2013

It looks as if :ColorToggle thinks it's on when in fact it was set on in another buffer.
You can repeat it roughly this way:

  • Open Vim
  • Split vertically
  • :e A.css
  • :ColorToggle
  • Jump to other split
  • :e B.css
  • :ColorToggle

And nothing happens. You'll have to toggle twice to get highlighting in the other file.

@chrisbra
Copy link
Owner

On Mo, 29 Jul 2013, Andri Möll wrote:

It looks as if :ColorToggle thinks it's on when in fact it was set on in another buffer.
You can repeat it roughly this way:

  • Open Vim
  • Split vertically
  • :e A.css
  • :ColorToggle
  • Jump to other split
  • :e B.css
  • :ColorToggle

And nothing happens. You'll have to toggle twice to get highlighting in the other file.

Thanks. Problem is, ColorToggle worked globally, and does not consider
the actual window. I think, this is fixed now.

regards,

Christian

Ein unnütz Leben ist ein früher Tod.
-- Johann Wolfgang von Goethe (Iphigenie)

@moll
Copy link
Author

moll commented Jul 30, 2013

Cool.

From the diff it looks like you switched the variables to use window local variables. I'm a bit confused — how do you envision this to work? In other issues we talked about making coloring be per-buffer (usually equivalent to per-file). Wouldn't it make more sense to store state in buffer variables?

@chrisbra
Copy link
Owner

Hi Andri!

On Di, 30 Jul 2013, Andri Möll wrote:

Cool.

From the diff it looks like you switched the variables to use window local variables. I'm a bit confused — how do you envision this to work? In other issues we talked about making coloring be per-buffer (usually equivalent to per-file). Wouldn't it make more sense to store state in buffer variables?

matching() is window-local, so we must use window-local variables.
Otherwise, when opening a new window with the same file, the buffer
local variable would be still alive, while the matching isn't active.

Liebe Grüße

Christian

Denn worin besteht die Barbarei anders als darin, daß man das
Vortreffliche nicht anerkennt.
-- Johann Wolfgang von Goethe (Zu J. P. Eckermann)

@moll
Copy link
Author

moll commented Jul 31, 2013

I'm not familiar with that part of Vim, but if you're saying that Vim sets such syntax highlighting per window and not per buffer, then my god, Vim is nuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants