On Sun, Dec 05, 2021 at 06:38:39PM +0000, Bram Moolenaar wrote:
>
> 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.
Cheers,
--
James
GPG Key: 4096R/91BF BF4D 6956 BD5D F7B7 2D23 DFE6 91AE 331B A3DB
--
--
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/20211205185738.ubau7ecs5xw2n5mt%40localhost.