dhruvasagar/vim-zoom

Background color

Closed this issue · 13 comments

How come when I zoom out back to the windows view, my background color changes from black to light grey?

My color scheme is gruvbox with the background variables set to dark.

The default is probably light grey if I remember, But I find it easier to read with black.. also nicer.

I know when I first zoom in, there is no change and when I zoom out it flashes black, then changes to grey and stays that color.

I found another "feature"
I had opened a browser file, had netrw open and a split window, then I did a :help topic.
I zoomed in on the help. Then I finished reading and did :q from the help that was zoomed in.
Instead of going back to the open windows, It quit vim.

So I tried it again only this time I had the same windows and another tab open with one file.
so when I quit the help from the zoom, It quit the windows and left me on the other open tab.

I didn't want to quit out, just the zoomed window.

@cool-clay Regarding the color, it must have something to do with the colorscheme, maybe the background vim setting. As far as quiting the help window, that's just vim again, when you quit the last window it quits vim.

I found another version, maybe the original version and it does not hve the color issue. So I'm thinking that it is not my .vimrc.

And the quitting thing. There were other windows, and files open. Even with changes, and it still did it, Also, while zoomed in, if I hit ctrl WW to switch windows, that terminated them.

The other version that I found has the same issues.

The other version doesn't look maintained anymore. But it works better on the background color so I'm using it. And the other, I guess I need to be careful.

Anyway, I do like the plugin. And I appreciate you caring on the project.

Maybe try out the windows thing..and see for yourself.

Will test more and let you know, thanks.

Hi there,

I have the same issue.

Note that the issue exists only if I use a colorschme. In my case dracula from dracula/vim.

If I remove the colorscheme, then the background is not altered when Unzooming.

@cool-clay are you also using dracula ? i'll try to reproduce this.

Hi,

I've had a look, and in fact, I set the the background color in my vimrc after the call to the colorscheme, like this

colo dracula
hi Normal ctermbg=233

And the point is that, when unzooming, the backgound color come back to the value of the colorscheme, not the one I defined manually after... (and other highlight command still defined after the colorscheme are also reset when unzooming.)

@dtrckd That's something the session handling can't handle I believe. Putting this in your vimrc may do the trick :

augroup Prosession
  au!

  autocmd User ProsessionPost hi Normal ctermbg=233
augroup END

I Just tried, it doesn't work.

@dtrckd sorry for the brain fart, that wasn't right.
I have just pushed and added a new user autocmd for zoom. namely ZoomPre and ZoomPost.

augroup Zoom
  au!

  autocmd User ZoomPost hi Normal ctermbg=233
augroup END

This may work, can you give it a shot ?

Ok, it brings back the settings like this. Thank you @dhruvasagar :).

Any idea how we could maybe update/change the colorcheme in order to make "sessionoptions" include all user hi options ? I have for example a dozens of hi options that overwrites the colorscheme, so they need to be copied twice in the vimrc which is maybe not the most elegant way of doing it?

@dtrckd I gave a quick look to sessionoptions before adding these autocmds, but it doesn't look like there's a way to do this. these highlight / syntax definitions aren't persisted.

As far as overriding the colorscheme, my advice would be to fork the original colorscheme and add the changes to it instead of doing these in your vimrc.

@dtrckd also, you could place all your customizations in a separate vim file and :source it both in vimrc and in the autocmd above