Hi Ingo!
On Sa, 26 Jan 2013, Ingo Karkat wrote:
> On 26-Jan-13 16:34:17 +0100, ZyX wrote:
>
> >> this patch adds the possibility to query for the existence of sign
> >> ids using exists().
> >>
> >> Current idea is to use exists('#number') to check for the numeric id
> >> (and thus it can't be an autocommand).
> >
> > I don’t like the overloading: exists('#…') is already ambigious*, don’
> > t make it more ambigious: it *can* be an autocmd group. I would rather
> > suggest “>N” for place ids and reserve “>>name” for defined sign
> > names.
> >
> > * “#abc” can mean “augroup” or “event”, same for “#abc#pattern”. Also
> > note that autocmd group name can contain a hash (and even a space
> > which prevents using it in :doau). Thus there is no way to check
> > whether random autocmd group is defined using “exists()” (“#abc#def”
> > is always “#event_or_group#pattern”).
ok.
What would be needed?
The following patch adds:
- exists('|nr')
returns true, if sign id nr exists
- exists('||name')
returns true, if sign name has been defined
- line('|nr')
returns the line number of sign id nr
- getsign('lnum')
returns the Sign id at line lnum in the current buffer
Anything else would be needed?
regards,
Christian
--
Der größte Sinnengenuß, der gar keine Beimischung von Ekel bei sich
führt, ist, im gesunden Zustande, Ruhe nach der Arbeit.
-- Immanuel Kant