Hi Bram,
On Mon, Jul 1, 2019 at 1:38 PM Bram Moolenaar <[email protected]> wrote:
>
>
> Yegappan wrote:
>
> > > > > > Thinking about this some more, we should modify the existing
> > > > > > sign_place() function to always accept a List argument
> > > > >
> > > > > Just to say, I don't have any strong feelings either way. I'll defer
> > > > > to those with more experience of the Vim API and how changes are made.
> > > >
> > > > The current sign_place() function is basically mimicking ":sign place".
> > > > One of the quirks is that it takes a file name, not a buffer number.
> > > >
> > >
> > > The sign_place() function accepts either a buffer name or a buffer
> > > number. The {expr} argument to sign_place() is same as the {expr}
> > > argument to bufname().
> > >
> > > >
> > > > It also has an optional {id}, where zero means it's not passed in.
> > > >
> > >
> > > Yes. Converting sign_place() to accept a List of dicts will make this
> > > simpler.
> > >
> > > >
> > > > Adding a new function that takes a list of dictionaries could be a good
> > > > alternative. We then do need to validate the entries to check if the
> > > > required keys are included. It will then be possible to either pass a
> > > > buffer number or a file name.
> > > >
> > >
> > > I have the changes for this ready to go (including the check for existence
> > > of the required keys). I will merge my local changes with the recent
> > > changes to sign.c/evalfunc.c and create a pull request.
> > >
> >
> > I have created PR #4602 (https://github.com/vim/vim/pull/4602) for this.
> > I have simplified the sign_place(), sign_unplace() and sign_getplaced()
> > functions. Took some time to make these changes as the sign tests heavily
> > use these functions. Note that this change is not backward compatible.
>
> The sign functions were added more than half a year ago. I don't think
> a change that is not backward compatible will be appreciated.
>
> I think for sign_define() we can support both the old arguments and a
> list argument. for sign_getplaced() we don't need changes. For
> place/unplace add a new "list" function:
>
> sign_define({name} [, {dict}])
> sign_define({list})
>
> sign_getplaced([{expr} [, {dict}]])
>
> sign_place({id}, {group}, {name}, {expr} [, {dict}])
> sign_placelist({list})
>
> sign_unplace({group} [, {dict}])
> sign_unplacelist({list})
>
> Does that sound reasonable?
>
Instead of adding the new sign_placelist() and sign_unplacelist() functions,
how about modifying the existing sign_place() and sign_unplace() functions
to also accept a {list} argument (similar to the sign_define() function above)?
So the new set of functions will be like below:
sign_define({name} [, {dict}])
sign_define({list})
sign_getplaced([{expr} [, {dict}]])
sign_place({id}, {group}, {name}, {expr} [, {dict}])
sign_place({list})
sign_unplace({group} [, {dict}])
sign_unplace({list})
- Yegappan
--
--
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/CAAW7x7nyvd6fRCeA_LF%2BUxTyoSymMNLEyVmw6uW-SJpm71Vk3Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.