James McCoy wrote:

> > > Why?  That complicates the plugin code the same way as dealing with this
> > > patch already would.  Whether a certain attribute is being defined or
> > > not by the plugin can change during runtime.
> > > 
> > > With this patch, any plugin doing that now needs to either always
> > > undefine signs before placing them or track whether attributes are set
> > > and adjust their calls accordingly.
> > 
> > Can you give an example of how an empty highlight argument can be
> > useful?
> 
> Right now Signify just has this:
> 
>     let s:delete_highlight = ['', 'SignifyLineDelete']
>     ...
>     function! s:add_sign(sy, line, type, ...) abort
>         ...
>         execute printf('sign define %s text=%s texthl=SignifySignDelete 
> linehl=%s',
>               \ a:type,
>               \ a:1,
>               \ s:delete_highlight[g:signify_line_highlight])
> 
> Depending on whether the user wants line highlights, a value is set for
> linehl.  This is simple code.
> 
> Without the latest patches, we need to handle this differently.  We
> either need to "silent! sign undefine" before defining signs to ensure
> the attributes are reset or we need to track whether
> g:signify_line_highlight changes and explicitly undefine all existing
> sign definitions.
> 
> Alternatively, we raise our minimum required Vim version so we can use
> sign_define() since that doesn't require specifying an empty linehl to
> remove the attribute.

OK, so you use the "linehl" argument always, but depending on the
situation the argument might be empty.

I suppose accidentally using an empty argument is unlikely to happen,
thus we can just remove the error message.  But keep the fix for
creating a highlight group with an empty name


-- 
Engineers understand that their appearance only bothers other people and
therefore it is not worth optimizing.
                                (Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20211205190836.AEE911C0BD1%40moolenaar.net.

Raspunde prin e-mail lui