Re: XML tag completion script

From: <briancsch....at.gmail.com>
Date: Mon, 12 Apr 2010 10:21:19 -0700 (PDT)

That's a bug. I'll have to figure out what triggers it. Probably the
lua pattern not detecting tags correctly. The script scans through the
file and builds a stack, pushing when an open tag is found, popping
when a close tag is found, and doing nothing when a tag like <this/>
is found. Using the auto-complete looks at the stack and inserts a
closing tag for whatever is on top. I won't be able to work on this
much until Tuesday evening.

- Brian

On Apr 11, 3:41 pm, phayz <russelldicken....at.gmail.com> wrote:
> On Mar 24, 12:59 pm, phayz <russelldicken....at.gmail.com> wrote:
>
>
>
> > On Mar 17, 1:10 pm, Brian Schott <briancsch....at.gmail.com> wrote:
>
> > > The line that says "require 'common.xmlcomplete'" is what ties the
> > > commands to the functions themselves. For this to work you need to place
> > > thexmlcomplete.lua in a location that can be found by Textadept. I put
> > > mine in ~/.textadept/modules/common (Thus the "common" in the require
> > > statement My argument being that this code is common to xml, html, and
> > > javadoc comments)
>
> > > - Brian
>
> > > On 03/15/10 20:00, phayz wrote:
>
> > > > I am still unsure of how I enable this script but I need to RTFM a
> > > > little more, also peek and poke around Textadept's directories.
>
> > > > As I understand I have a Lua script, which needs to be run when
> > > > certain key sequences are pressed, and the latter is where the
> > > > "commands.lua for xml (placed in ~/.textadept/modules/xml/
> > > > commands.lua)" comes into play). What I am still struggling with is
> > > > knowing how these two are linked.
>
> > > > Regards,
>
> > > > Russell Dickenson (AKA phayz)
>
> > Brian,
>
> > You have been a great help to myself, other TA users also, I expect.
> > Could you please help me just a little more? I need a dummies guide to
> > enabling this functionality because I have tried many combinations and
> > permutations and just can't seem to get it right.
>
> > Regards,
>
> > Russell Dickenson
>
> Brian et al,
>
> I am seeing odd behaviour from the xmlcomplete script. While editing a
> hypertext document I added a new "<h3>" tag and instead of the closing
> "</h3>" being inserted, a "</td>" was inserted instead. I tried
> throughout the document to insert several different tags and in most
> cases, an "</td>" tag was inserted. The exception was when I put the
> cursor at the very end of the file and typed in an "<head>" tag, when
> the correct closing tag of "</head>" was inserted. Thinking that the
> problem was with this document I created a new sample hypertext file
> and inserted a few standard tags. In this file I couldn't recreate the
> problem, so it looked to be the original document. I then opened one
> of the Textadept manual files, in hypertext format, and again did some
> tests. Again, Textadept was inserting the wrong tag - most often a "</
> td>", sometimes a "</p>" tag. As an example, I open
> "1_Introduction.html", go to the blank line after the unordered list
> for "<h1>Manual</h1>", type in a "<h3>" tag and a "</p>" tag is
> automatically inserted.
>
> This is occurring under both Linux (with latest official Textadept
> release) and Windows (with Textadept 2.2 beta).
>
> I'll do a little more investigation and see what I can find.
>
> Regards,
>
> Russell Dickenson
Received on Mon 12 Apr 2010 - 13:21:19 EDT

This archive was generated by hypermail 2.2.0 : Thu 08 Mar 2012 - 11:38:53 EST