Friday, November 13, 2015

Use a different background color if file is opened in readonly mode broken?

I'm using gvim 7.4.691 at the moment. I have the following in my .vimrc file to change the color if I open a file in readonly mode:

" Use a different color background if file is opened in readonly mode.
if &readonly
highlight Normal guibg=White guifg=DarkCyan
else
highlight Normal guibg=Wheat guifg=Brown
endif

If I open gvim in read only mode without a file name, it works fine, changing the color as I expect:

$ gvim -R

but if I open a file in read only mode and specify a file name, it does open the file in read only mode, but with the non-readonly color.

$ gvim -R myfile.txt

My recollection is this worked as expected in some past versions of gvim some years ago, though I don't recall when it broke.

Can anyone reproduce this and tell me if I'm doing something wrong or if this is a bug?

Thanks ... Dan Nygren

,

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: