[Geany] The plugin - Re: Use snippets for HTML autocompletion?

Nick Treleaven nick.treleaven at xxxxx
Wed Nov 17 14:48:49 UTC 2010


On Tue, 16 Nov 2010 19:06:59 +0300
Eugene Arshinov <earshinov at gmail.com> wrote:

> > > > In [HTML] section I have a snippet
> > > > 
> > > >   lia=<li><a href="%cursor%">%cursor%</a></li>
> > > > 
> > > > It begins with a tag, so the plugin will insert it after I type
> > > > <lia> (it will result in <lia><li><a ...>...</a></li> which isn't
> > > > useful).
> > > 
> > > Why would <lia> be kept? That should be removed, otherwise <table>
> > > would result in <table><table>...</table>
> > 
> > Yes, removing the tag is a good idea, especially if we account that
> > it's how "ordinary" snippets work now.  I had an idea that for
> > snippets for the plugin snippet body should contain only the part
> > that's inserted (i.e., shouldn't contain the first open tag) because
> > it easily allows to save attributes user may have specified in the
> > open tag that gets autocompleted.  If we remove this tag, we'll have
> > to copy the attributes to the first tag within snippet body, but I
> > think it's easy to implement.

I would implement it to not autocomplete tags with attributes, only
match '<' + snippet_name + '>'. The user could add any attributes after
snippet insertion. 

> > 
> 
> …easy to implement if we don't consider the case when the first tag
> already contains attributes, especially when names of those attributes
> match the ones of the attributes user entered in the autocompleted tag…

Nick



More information about the Users mailing list