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

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

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

Comments

Projects
None yet
2 participants

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.

Owner

chrisbra commented Jul 30, 2013

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 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?

Owner

chrisbra commented Jul 30, 2013

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 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.

@chrisbra chrisbra closed this Aug 27, 2013

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