Friday, November 17, 2023

Re: Track changes to readonly

On Do, 16 Nov 2023, 'Aaron Heifetz' via vim_use wrote:

> I wonder how it is possible to react to changes to a buffer's readonly flag
> both,
> - after starting vi, e.g. with gvim -c "set ro" (not gvim -R), and
> - when changing the flag via the command line.

I don't understand the difference between those two checks. For the
first one, you can call a function on VimEnter, check the flag and set
your background color, see also the 'wincolor' setting. But how do you
change the flag via the command line, if not during startup?

You may also trigger a function on an OptionSet autocommand, that reacts
to setting those option values after startup.

Thanks,
Christian
--
Hell is empty and all the devils are here.
-- Wm. Shakespeare, "The Tempest"

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/ZVdUIe6%2BOcRjjXrZ%40256bit.org.

No comments:

Post a Comment