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

Bug in "it" and "at" text objects

Expand Messages
  • Ben Fritz
    Using this XML snippet: content
    Message 1 of 3 , Sep 30, 2011
    • 0 Attachment
      Using this XML snippet:

      <?xml version="1.0"?>
      <root_tag>
      <SomeTag>
      <SomeTagPlusText>content</SomeTagPlusText>
      </SomeTag>
      <another_tag></another_tag>
      </root_tag>

      I place my cursor on SomeTag and hit vit. It acts like I placed my
      cursor on root_tag. Same with vat. In other words, vat selects the
      entire <root_tag>...</root_tag> text, whereas I expect it to highlight
      only <SomeTag>...</SomeTag>

      If I make a minor change to the XML:

      <?xml version="1.0"?>
      <root_tag>
      <SomeTag>
      <SomeOtherTag>content</SomeOtherTag>
      </SomeTag>
      <another_tag></another_tag>
      </root_tag>

      Then everything works as I expect. Pressing vat on SomeTag will
      highlight only from <SomeTag> to </SomeTag>.

      It does not seem to depend on the length of the tag. This also does
      not work:

      <?xml version="1.0"?>
      <root_tag>
      <T>
      <T2>content</T2>
      </T>
      <another_tag></another_tag>
      </root_tag>

      Visual mode is not needed, it also acts on the wrong area when using
      dat for example (which is what I tried first, got confused, pressed u,
      tried again, got frustrated, used V%d instead).

      This is with gvim -N -u NONE -i NONE on 64-bit Windows XP.


      VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 29 2011 13:23:47)
      MS-Windows 32-bit GUI version with OLE support
      Included patches: 1-289
      Compiled by digitectNO@...
      Huge version with GUI. Features included (+) or not (-):
      +arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset
      +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist
      +cmdline_info +comments
      +conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui
      +diff +digraphs -dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search
      +farsi
      +file_in_path +find_in_path +float +folding -footer +gettext/dyn -
      hangul_input +iconv/dyn +insert_expand +jumplist +keymap +langmap
      +libcall +linebreak
      +lispindent +listcmds +localmap +lua/dyn +menu +mksession
      +modify_fname +mouse +mouseshape +multi_byte_ime/dyn +multi_lang
      +mzscheme/dyn +netbeans_intg +ole
      +path_extra +perl/dyn +persistent_undo -postscript +printer +profile
      +python/dyn -python3 +quickfix +reltime +rightleft +ruby/dyn
      +scrollbind +signs
      +smartindent -sniff +startuptime +statusline -sun_workshop +syntax
      +tag_binary +tag_old_static -tag_any_white +tcl/dyn -tgetent -
      termresponse +textobjects
      +title +toolbar +user_commands +vertsplit +virtualedit +visual
      +visualextra +viminfo +vreplace +wildignore +wildmenu +windows
      +writebackup -xfontset -xim
      -xterm_save -xpm_w32

      --
      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
      ... [...] I confirm the problem on the current 7.3.328 for Linux64 with the examples given. It seems to depend on the presence of an inner tag whose name
      Message 2 of 3 , Sep 30, 2011
      • 0 Attachment
        On 30/09/11 18:04, Ben Fritz wrote:
        > Using this XML snippet:
        >
        > <?xml version="1.0"?>
        > <root_tag>
        > <SomeTag>
        > <SomeTagPlusText>content</SomeTagPlusText>
        > </SomeTag>
        > <another_tag></another_tag>
        > </root_tag>
        >
        > I place my cursor on SomeTag and hit vit. It acts like I placed my
        > cursor on root_tag. Same with vat. In other words, vat selects the
        > entire<root_tag>...</root_tag> text, whereas I expect it to highlight
        > only<SomeTag>...</SomeTag>
        >
        > If I make a minor change to the XML:
        >
        > <?xml version="1.0"?>
        > <root_tag>
        > <SomeTag>
        > <SomeOtherTag>content</SomeOtherTag>
        > </SomeTag>
        > <another_tag></another_tag>
        > </root_tag>
        >
        > Then everything works as I expect. Pressing vat on SomeTag will
        > highlight only from<SomeTag> to</SomeTag>.
        >
        > It does not seem to depend on the length of the tag. This also does
        > not work:
        >
        > <?xml version="1.0"?>
        > <root_tag>
        > <T>
        > <T2>content</T2>
        > </T>
        > <another_tag></another_tag>
        > </root_tag>
        >
        > Visual mode is not needed, it also acts on the wrong area when using
        > dat for example (which is what I tried first, got confused, pressed u,
        > tried again, got frustrated, used V%d instead).
        >
        > This is with gvim -N -u NONE -i NONE on 64-bit Windows XP.
        >
        >
        > VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 29 2011 13:23:47)
        > MS-Windows 32-bit GUI version with OLE support
        > Included patches: 1-289
        > Compiled by digitectNO@...
        > Huge version with GUI. Features included (+) or not (-):
        [...]

        I confirm the problem on the current 7.3.328 for Linux64 with the
        examples given. It seems to depend on the presence of an inner tag whose
        name starts with the name of the outer tag.

        VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Sep 30 2011 17:57:46)
        Included patches: 1-328
        Compiled by antoine.mechelynck@...
        Huge version with GTK2-GNOME GUI. Features included (+) or not (-):
        [...]


        Best regards,
        Tony.
        --
        "I appreciate the fact that this draft was done in haste, but some of
        the sentences that you are sending out in the world to do your work for
        you are loitering in taverns or asleep beside the highway."
        -- Dr. Dwight Van de Vate, Professor of Philosophy,
        University of Tennessee at Knoxville

        --
        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
        ... Right, it appears there is no proper check for the end of the tag name. -- hundred-and-one symptoms of being an internet addict: 37. You start looking for
        Message 3 of 3 , Oct 1, 2011
        • 0 Attachment
          Ben Fritz wrote:

          > Using this XML snippet:
          >
          > <?xml version="1.0"?>
          > <root_tag>
          > <SomeTag>
          > <SomeTagPlusText>content</SomeTagPlusText>
          > </SomeTag>
          > <another_tag></another_tag>
          > </root_tag>
          >
          > I place my cursor on SomeTag and hit vit. It acts like I placed my
          > cursor on root_tag. Same with vat. In other words, vat selects the
          > entire <root_tag>...</root_tag> text, whereas I expect it to highlight
          > only <SomeTag>...</SomeTag>
          >
          > If I make a minor change to the XML:
          >
          > <?xml version="1.0"?>
          > <root_tag>
          > <SomeTag>
          > <SomeOtherTag>content</SomeOtherTag>
          > </SomeTag>
          > <another_tag></another_tag>
          > </root_tag>
          >
          > Then everything works as I expect. Pressing vat on SomeTag will
          > highlight only from <SomeTag> to </SomeTag>.
          >
          > It does not seem to depend on the length of the tag. This also does
          > not work:
          >
          > <?xml version="1.0"?>
          > <root_tag>
          > <T>
          > <T2>content</T2>
          > </T>
          > <another_tag></another_tag>
          > </root_tag>
          >
          > Visual mode is not needed, it also acts on the wrong area when using
          > dat for example (which is what I tried first, got confused, pressed u,
          > tried again, got frustrated, used V%d instead).
          >
          > This is with gvim -N -u NONE -i NONE on 64-bit Windows XP.

          Right, it appears there is no proper check for the end of the tag name.

          --
          hundred-and-one symptoms of being an internet addict:
          37. You start looking for hot HTML addresses in public restrooms.

          /// 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
        Your message has been successfully submitted and would be delivered to recipients shortly.