Loading ...
Sorry, an error occurred while loading the content.

Re: Problem with "it" and "at" text objects on nested elements with similar names

Expand Messages
  • James McCoy
    ... This was fixed in patch 7.3.331: changeset: 3290:4b8c614c1c91 tag: v7-3-331 user: Bram Moolenaar date: Tue Oct 04
    Message 1 of 7 , Nov 2, 2011
    • 0 Attachment
      On Wed, Nov 2, 2011 at 2:32 PM, zrth <detrith@...> wrote:
      > Hello,
      >
      > If I use "vat" with the cursor on <list> it selects the "root" element
      > instead of "list". The same goes for "it".
      > It selects the contents of "root" and not the contents of "list" (as
      > expected). I guess the problem is that the parent element's name is a
      > substring of the child's name.

      This was fixed in patch 7.3.331:

      changeset: 3290:4b8c614c1c91
      tag: v7-3-331
      user: Bram Moolenaar <bram@...>
      date: Tue Oct 04 17:00:20 2011 +0200
      files: src/search.c src/version.c
      description:
      updated for version 7.3.331
      Problem: "vit" selects wrong text when a tag name starts with the same text
      as an outer tag name. (Ben Fritz)
      Solution: Add "\>" to the pattern to check for word boundary.

      Cheers,
      --
      James
      GPG Key: 1024D/61326D40 2003-09-02 James McCoy <jamessan@...>
      --
      James
      GPG Key: 1024D/61326D40 2003-09-02 James McCoy <jamessan@...>

      --
      You received this message from the "vim_dev" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Tony Mechelynck
      ... Maybe something related was fixed in 7.3.331, but I can reproduce _this_ problem in 7.3.353 (see :version heading at bottom of this post). In addition, if
      Message 2 of 7 , Nov 2, 2011
      • 0 Attachment
        On 02/11/11 20:12, James McCoy wrote:
        > On Wed, Nov 2, 2011 at 2:32 PM, zrth<detrith@...> wrote:
        >> Hello,
        >>
        >> If I use "vat" with the cursor on<list> it selects the "root" element
        >> instead of "list". The same goes for "it".
        >> It selects the contents of "root" and not the contents of "list" (as
        >> expected). I guess the problem is that the parent element's name is a
        >> substring of the child's name.
        >
        > This was fixed in patch 7.3.331:
        >
        > changeset: 3290:4b8c614c1c91
        > tag: v7-3-331
        > user: Bram Moolenaar<bram@...>
        > date: Tue Oct 04 17:00:20 2011 +0200
        > files: src/search.c src/version.c
        > description:
        > updated for version 7.3.331
        > Problem: "vit" selects wrong text when a tag name starts with the same text
        > as an outer tag name. (Ben Fritz)
        > Solution: Add "\>" to the pattern to check for word boundary.
        >
        > Cheers,

        Maybe something related was fixed in 7.3.331, but I can reproduce _this_
        problem in 7.3.353 (see :version heading at bottom of this post).

        In addition, if I place the cursor on the "text" text, then hit v and
        repeatedly it, the visual area extends itself as follows:

        text

        <p>text</p>

        the insides of <list-item> excluding the boundary tags

        <list-item> including the boundary tags

        the insides of <root> excluding the boundary tags

        <root> including the boundary tags

        and finally beeps (I have an empty line above <root>).

        The <list>...</list> tags are completely ignored, as if they didn't exist.


        'filetype' empty or set to xml makes no difference except in the
        highlight colours.


        VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Oct 27 2011 01:33:58)
        Included patches: 1-353
        Compiled by antoine.mechelynck@...
        Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
        [...]


        Best regards,
        Tony.
        --
        Ken Thompson has an automobile which he helped design. Unlike most
        automobiles, it has neither speedometer, nor gas gauge, nor any of the
        numerous idiot lights which plague the modern driver. Rather, if the
        driver makes any mistake, a giant "?" lights up in the center of the
        dashboard. "The experienced driver", he says, "will usually know
        what's wrong."

        --
        You received this message from the "vim_dev" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • James McCoy
        On Wed, Nov 2, 2011 at 4:33 PM, Tony Mechelynck ... Ah, you re right. I should ve double checked first. ... That seems to be documented at :help tag-blocks .
        Message 3 of 7 , Nov 2, 2011
        • 0 Attachment
          On Wed, Nov 2, 2011 at 4:33 PM, Tony Mechelynck
          <antoine.mechelynck@...> wrote:
          > On 02/11/11 20:12, James McCoy wrote:
          >>
          >> On Wed, Nov 2, 2011 at 2:32 PM, zrth<detrith@...>  wrote:
          >>>
          >>> Hello,
          >>>
          >>> If I use "vat" with the cursor on<list>  it selects the "root" element
          >>> instead of "list". The same goes for "it".
          >>> It selects the contents of "root" and not the contents of "list" (as
          >>> expected). I guess the problem is that the parent element's name is a
          >>> substring of the child's name.
          >>
          >> This was fixed in patch 7.3.331:
          >>
          >> changeset:   3290:4b8c614c1c91
          >> tag:         v7-3-331
          >> user:        Bram Moolenaar<bram@...>
          >> date:        Tue Oct 04 17:00:20 2011 +0200
          >> files:       src/search.c src/version.c
          >> description:
          >> updated for version 7.3.331
          >> Problem:    "vit" selects wrong text when a tag name starts with the same
          >> text
          >>        as an outer tag name. (Ben Fritz)
          >> Solution:   Add "\>" to the pattern to check for word boundary.
          >>
          >> Cheers,
          >
          > Maybe something related was fixed in 7.3.331, but I can reproduce _this_
          > problem in 7.3.353 (see :version heading at bottom of this post).

          Ah, you're right. I should've double checked first.

          > In addition, if I place the cursor on the "text" text, then hit v and
          > repeatedly it, the visual area extends itself as follows:

          That seems to be documented at ":help tag-blocks".

          --
          James
          GPG Key: 1024D/61326D40 2003-09-02 James McCoy <jamessan@...>

          --
          You received this message from the "vim_dev" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        • Tony Mechelynck
          ... My concern was not that it extended exclusive - inclusive - exclusive etc., but that it missed the and tags completely, halting on neither
          Message 4 of 7 , Nov 2, 2011
          • 0 Attachment
            On 02/11/11 21:43, James McCoy wrote:
            > On Wed, Nov 2, 2011 at 4:33 PM, Tony Mechelynck
            > <antoine.mechelynck@...> wrote:
            >> On 02/11/11 20:12, James McCoy wrote:
            >>>
            >>> On Wed, Nov 2, 2011 at 2:32 PM, zrth<detrith@...> wrote:
            >>>>
            >>>> Hello,
            >>>>
            >>>> If I use "vat" with the cursor on<list> it selects the "root" element
            >>>> instead of "list". The same goes for "it".
            >>>> It selects the contents of "root" and not the contents of "list" (as
            >>>> expected). I guess the problem is that the parent element's name is a
            >>>> substring of the child's name.
            >>>
            >>> This was fixed in patch 7.3.331:
            >>>
            >>> changeset: 3290:4b8c614c1c91
            >>> tag: v7-3-331
            >>> user: Bram Moolenaar<bram@...>
            >>> date: Tue Oct 04 17:00:20 2011 +0200
            >>> files: src/search.c src/version.c
            >>> description:
            >>> updated for version 7.3.331
            >>> Problem: "vit" selects wrong text when a tag name starts with the same
            >>> text
            >>> as an outer tag name. (Ben Fritz)
            >>> Solution: Add "\>" to the pattern to check for word boundary.
            >>>
            >>> Cheers,
            >>
            >> Maybe something related was fixed in 7.3.331, but I can reproduce _this_
            >> problem in 7.3.353 (see :version heading at bottom of this post).
            >
            > Ah, you're right. I should've double checked first.
            >
            >> In addition, if I place the cursor on the "text" text, then hit v and
            >> repeatedly it, the visual area extends itself as follows:
            >
            > That seems to be documented at ":help tag-blocks".
            >

            My concern was not that it extended exclusive - inclusive - exclusive
            etc., but that it missed the <list> and </list> tags completely, halting
            on neither side of them.

            Best regards,
            Tony.
            --
            A year spent in artificial intelligence is enough to make one believe
            in God.

            --
            You received this message from the "vim_dev" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php
          • Bram Moolenaar
            ... I wonder if a dash inside a tag name is actually valid. In XML perhaps? Any other characters that should be considered part of the tag name? -- You re as
            Message 5 of 7 , Nov 20, 2011
            • 0 Attachment
              Detrith wrote:

              > If I use "vat" with the cursor on <list> it selects the "root" element
              > instead of "list". The same goes for "it".
              > It selects the contents of "root" and not the contents of "list" (as
              > expected). I guess the problem is that the parent element's name is a
              > substring of the child's name.
              >
              > <root>
              > <list>
              > <list-item>
              > <p>text</p>
              > </list-item>
              > </list>
              > </root>

              I wonder if a dash inside a tag name is actually valid. In XML perhaps?
              Any other characters that should be considered part of the tag name?

              --
              You're as much use as a condom machine at the Vatican.
              -- Rimmer to Holly in Red Dwarf 'Queeg'

              /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
              /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
              \\\ an exciting new programming language -- http://www.Zimbu.org ///
              \\\ help me help AIDS victims -- http://ICCF-Holland.org ///

              --
              You received this message from the "vim_dev" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php
            • Tony Mechelynck
              ... For XML 1.1, see items [4] and [4a] at http://www.w3.org/TR/xml11/#NT-NameStartChar (any Name may be a tag name.) Dashes are allowed, except as the first
              Message 6 of 7 , Nov 20, 2011
              • 0 Attachment
                On 21/11/11 00:47, Bram Moolenaar wrote:
                >
                > Detrith wrote:
                >
                >> If I use "vat" with the cursor on<list> it selects the "root" element
                >> instead of "list". The same goes for "it".
                >> It selects the contents of "root" and not the contents of "list" (as
                >> expected). I guess the problem is that the parent element's name is a
                >> substring of the child's name.
                >>
                >> <root>
                >> <list>
                >> <list-item>
                >> <p>text</p>
                >> </list-item>
                >> </list>
                >> </root>
                >
                > I wonder if a dash inside a tag name is actually valid. In XML perhaps?
                > Any other characters that should be considered part of the tag name?
                >

                For XML 1.1, see items [4] and [4a] at
                http://www.w3.org/TR/xml11/#NT-NameStartChar (any Name may be a tag
                name.) Dashes are allowed, except as the first character.


                Best regards,
                Tony.
                --
                Infancy, n.:
                The period of our lives when, according to Wordsworth, "Heaven
                lies about us." The world begins lying about us pretty soon
                afterward.
                -- Ambrose Bierce

                --
                You received this message from the "vim_dev" maillist.
                Do not top-post! Type your reply below the text you are replying to.
                For more information, visit http://www.vim.org/maillist.php
              Your message has been successfully submitted and would be delivered to recipients shortly.