1 Dec 2005 05:31
Re: [PATCH] new flags for the search() function
Benji Fisher <benji <at> member.AMS.org>
2005-12-01 04:31:58 GMT
2005-12-01 04:31:58 GMT
On Wed, Nov 30, 2005 at 08:29:40PM +0100, Bram Moolenaar wrote:
>
> Benji Fisher wrote:
>
> The example looks fine to me. But I'm not sure if the explanation is
> clear, e.g., what "keyword at the current cursor position" means
> exactly. Perhaps a few snippets of example text will help.
OK, I will try another draft at the bottom of this note.
> > I have updated the patch to add Yet Another Flag: 'c' tells the
> > function (search() or searchpair()) to return the column number of the
> > match instead of the line number. (Give an error message if combined
> > with 'p' or 'm'.)
>
> Alternative: add a new function that returns a list with both the line
> and column number. Otherwise you would need to search twice to get
> both.
>
> :let [lnum, col] = search???()
That project is too ambitious for me (at least for now).
> > rettv->vval.v_number = (flags & S_SUBPAT) ? subpatnum :
> > ((flags & SP_RETCOLUMN) ? 1 + pos.col : pos.lnum);
> >
> > v_number varnumber_T int or long (if SIZEOF_INT <= 3)
> > pos.lnum linenr_T long
>
> Yes, casts are needed here to avoid a warning message from some
(Continue reading)
> > I have updated the patch to add Yet Another Flag: 'c'
> tells the
> > function (search() or searchpair()) to return the column
> number of the
> > match instead of the line number. (Give an error message
> if combined
> > with 'p' or 'm'.)
>
> Alternative: add a new function that returns a list with both the line
RSS Feed