On Tue, Sep 27, 2016 at 10:10 PM, Christian Brabandt <[email protected]> wrote:
> Bram,
> I maintain the popular eye-candy plugin vim-airline. For files
> maintained in git, it checks the current branch and displays it in the
> statusline using system('git status...') and caches the result, so that
> it is not called to often. However after a ShellCmdPost autocommand, it
> invalidates the cache and runs the command to update it (since the user
> could have interacted with git using !git..)

Why *must* the plugin do this in ShellCmdPost? Why can't it set a flag
and then refresh the cache on CursorMoved or CursorHold? This is not a
strong case for making this variable writable.

Keeping variables read-only makes it easier to reason about things.
Very few v: vars are writable, and each time it's slightly convenient
someone asks to make them writable.

I believe ZyX also noted that calling system() in a ShellCmdPost is a
code smell.

---

Justin M. Keyes

-- 
-- 
You received this message from the "vim_dev" 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_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui