Saturday, November 18, 2023

Re: Track changes to readonly

@Christan

Thanks! "OptionSet" was the event I had been looking for. I actually failed to recognize it...

On Friday, November 17, 2023 at 12:53:16 PM UTC+1 Christian Brabandt wrote:

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/9909ad14-93b3-4a05-b19e-460f581b2708n%40googlegroups.com.

No comments: