Menu

#200 xml::electricClosingAngleBracket : two issues

9.0.2
closed
nobody
None
Bug
AlphaTcl
minor
2018-12-21
2018-11-19
No

In XML mode, xml::electricClosingAngleBracket offers to insert the end-tag of an XML element while typing the closing ">" of the start-tag.

I have noted two issues:

  • with prefixed element name (QName), for instance "xsl:param", only "xsl" is inserted in the end tag. It is due to the regexp used for matching the start tag:

regexp -- {[\w]+} $tag tag
l. 511 of Modes/XML Modes/xmlMode.tcl
I think it could be turned into:

regexp -- {[\w]*:?[\w]+} $tag tag

  • second ; when typing a start-tag at the very end of a document (the cursor is at the last position), the closing tag is not inserted. I havn't been able to trace the issue. It may be a common situation to enter the root element of a document and to expect it to be closed also.

Best,
Sylvain

Discussion

  • Sylvain Loiseau

    Sylvain Loiseau - 2018-11-19

    Edit : something like :

    regexp -- {([\w]+:)?[\w]+} $tag tag
    

    could be better, since the ":" is supposed to appear only if there is a prefix.
    Best regards,
    Sylvain

     
  • Bernard Desgraupes

    Both issues are fixed now.
    Regarding the first one, thanks for the regexp. One can even write just

    regexp -- {(\w+:)?\w+} $tag tag
    

    The second issue was a core bug (an index out of bounds which caused Cocoa to raise an exception and stop processing).

    Changes committed to the repository (rev. 1577 (sourceforge.net)). The core must be rebuilt (for the second issue only).

     
  • Bernard Desgraupes

    • status: open --> fixed
     
  • Bernard Desgraupes

    • status: fixed --> closed
    • Version: 9.0.1 --> 9.0.2
     

Log in to post a comment.

MongoDB Logo MongoDB