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?

-- 
   An extraordinary TALL KNIGHT in all black (possibly John with Mike on his
   shoulders) walks out from the dark trees.  He is extremely fierce and
   gruesome countenance.  He walks towards KING ARTHUR and PATSY, who are
   wazzing like mad.  (Salopian slang, meaning very scared.  almost to the
   point of wetting oneself, e.g. before an important football match or
   prior to a postering.  Salopian slang meaning a beating by the school
   praeposters.  Sorry about the Salopian slant to this stage direction - Ed.)
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/201907012038.x61KcrVb020618%40masaka.moolenaar.net.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui