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 [email protected]
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 [email protected]
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

Raspunde prin e-mail lui