Bug: surround-read-tag matches wrong tag when there is mixed content

Christoph LANGE langec at web.de
Mon Nov 21 17:41:14 CET 2011


Dear evil-surround developers,

I think I found a bug in surround-read-tag; well, I think that's the 
movement function that is bound to the key sequence "st".  I'm using the 
latest versions of evil and of evil-surround.

First a simple example that works; "|" indicates the cursor position.

<simple>te|xt</simple>

cstt and then "foo" RET results, as expected, in

|<foo>text</foo>

In mixed XML content, i.e. elements that contain elements as well as 
plain text, it doesn't work.

Example 1:

Given: <outer><inner>te|xt</inner> other text</outer>

Input: cstt and then "foo" RET

Expected: <outer>|<foo>text</foo> other text</outer>

Actually: <outer><foo><inner>text</inner></foo></outer>

and you see that the first press of the "t" key already deletes the 
"other text".

Example 2:

Given: <outer><inner>text</inner> other |text</outer>

Input: cstt and then "foo" RET (same as example 1)

Expected: |<foo><inner>text</inner> other text</outer>

Actually: <outer><foo><inner>text</inner></foo></outer> (same as example 1)

Cheers,

Christoph

-- 
Christoph Lange, http://www.facebook.com/ch.lange, Skype duke4701



More information about the implementations-list mailing list