diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-03-05 19:57:49 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-03-05 19:57:49 +0100 |
commit | b6c2735c56f1541159e1ad95c3f17a52b3a94f1d (patch) | |
tree | 6f0a5ed3e793823152c28b61635b16e3f8f88143 /src | |
parent | a245bc79b4c6b83a4b5b6cdb95c4d2165762a20b (diff) |
updated for version 7.4.655v7.4.655
Problem: Text deleted by "dit" depends on indent of closing tag.
(Jan Parthey)
Solution: Do not adjust oap->end in do_pending_operator(). (Christian
Brabandt)
Diffstat (limited to 'src')
-rw-r--r-- | src/normal.c | 8 | ||||
-rw-r--r-- | src/search.c | 16 | ||||
-rw-r--r-- | src/testdir/test53.in | 4 | ||||
-rw-r--r-- | src/testdir/test53.ok | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
5 files changed, 27 insertions, 4 deletions
diff --git a/src/normal.c b/src/normal.c index 987705d4c6..d173c737b9 100644 --- a/src/normal.c +++ b/src/normal.c @@ -9198,6 +9198,14 @@ nv_object(cap) flag = current_block(cap->oap, cap->count1, include, '<', '>'); break; case 't': /* "at" = a tag block (xml and html) */ + /* Do not adjust oap->end in do_pending_operator() + * otherwise there are different results for 'dit' + * (note leading whitespace in last line): + * 1) <b> 2) <b> + * foobar foobar + * </b> </b> + */ + cap->retval |= CA_NO_ADJ_OP_END; flag = current_tagblock(cap->oap, cap->count1, include); break; case 'p': /* "ap" = a paragraph */ diff --git a/src/search.c b/src/search.c index 3276a77b7a..8beacbbc3f 100644 --- a/src/search.c +++ b/src/search.c @@ -1063,7 +1063,7 @@ first_submatch(rp) * Careful: If spats[0].off.line == TRUE and spats[0].off.off == 0 this * makes the movement linewise without moving the match position. * - * return 0 for failure, 1 for found, 2 for found and line offset added + * Return 0 for failure, 1 for found, 2 for found and line offset added. */ int do_search(oap, dirc, pat, count, options, tm) @@ -3781,6 +3781,7 @@ current_tagblock(oap, count_arg, include) int do_include = include; int save_p_ws = p_ws; int retval = FAIL; + int is_inclusive = TRUE; p_ws = FALSE; @@ -3895,8 +3896,15 @@ again: } else { - /* Exclude the '<' of the end tag. */ - if (*ml_get_cursor() == '<') + char_u *c = ml_get_cursor(); + + /* Exclude the '<' of the end tag. + * If the closing tag is on new line, do not decrement cursor, but + * make operation exclusive, so that the linefeed will be selected */ + if (*c == '<' && !VIsual_active && curwin->w_cursor.col == 0) + /* do not decrement cursor */ + is_inclusive = FALSE; + else if (*c == '<') dec_cursor(); } end_pos = curwin->w_cursor; @@ -3950,7 +3958,7 @@ again: oap->inclusive = FALSE; } else - oap->inclusive = TRUE; + oap->inclusive = is_inclusive; } retval = OK; diff --git a/src/testdir/test53.in b/src/testdir/test53.in index 8ca9c9ed29..7c35b2e853 100644 --- a/src/testdir/test53.in +++ b/src/testdir/test53.in @@ -23,6 +23,7 @@ jfXdit 0fXdit fXdat 0fXdat +dit :" :put =matchstr(\"abcd\", \".\", 0, 2) " b :put =matchstr(\"abcd\", \"..\", 0, 2) " bc @@ -97,6 +98,9 @@ voo "nah" sdf " asdf" sdf " sdf" sd -<b>asdX<i>a<i />sdf</i>asdf</b>- -<b>asdf<i>Xasdf</i>asdf</b>- -<b>asdX<i>as<b />df</i>asdf</b>- +-<b> +innertext object +</b> </begin> SEARCH: foobar diff --git a/src/testdir/test53.ok b/src/testdir/test53.ok index 0c0b9ded16..05206972a4 100644 --- a/src/testdir/test53.ok +++ b/src/testdir/test53.ok @@ -11,6 +11,7 @@ voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd -<b></b>- -<b>asdfasdf</b>- -- +-<b></b> </begin> b bc diff --git a/src/version.c b/src/version.c index a814baf361..81f4d4122b 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 655, +/**/ 654, /**/ 653, |