aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-12-13 00:35:09 -0500
committerJustin M. Keyes <justinkz@gmail.com>2015-12-13 00:35:09 -0500
commit3c9d8ac99e0df7701855f5b534b4202aa0a21bb2 (patch)
treecb0e0588ceebe368aee048fc12f1e753bba94f17 /src
parent014d692013c58e31a1456d218d2b38b857e6cef3 (diff)
parentcfa2107e33e98c35a2f08236ef6816fbae7cc8f1 (diff)
downloadrneovim-3c9d8ac99e0df7701855f5b534b4202aa0a21bb2.tar.gz
rneovim-3c9d8ac99e0df7701855f5b534b4202aa0a21bb2.tar.bz2
rneovim-3c9d8ac99e0df7701855f5b534b4202aa0a21bb2.zip
Merge #3718 'vim-patch:7.4.655'
Diffstat (limited to 'src')
-rw-r--r--src/nvim/normal.c7
-rw-r--r--src/nvim/search.c19
-rw-r--r--src/nvim/testdir/test53.in4
-rw-r--r--src/nvim/testdir/test53.ok1
-rw-r--r--src/nvim/version.c2
5 files changed, 27 insertions, 6 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index ad53e9bf24..a2e473fcb8 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -7466,6 +7466,13 @@ static void nv_object(cmdarg_T *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/nvim/search.c b/src/nvim/search.c
index cb461c9ef2..fb7dfa350b 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -918,7 +918,7 @@ static int first_submatch(regmmatch_T *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(
oparg_T *oap, /* can be NULL */
@@ -3193,6 +3193,7 @@ current_tagblock (
int do_include = include;
bool save_p_ws = p_ws;
int retval = FAIL;
+ int is_inclusive = true;
p_ws = false;
@@ -3287,9 +3288,16 @@ again:
if (inc_cursor() < 0)
break;
} else {
- /* Exclude the '<' of the end tag. */
- if (*get_cursor_pos_ptr() == '<')
+ char_u *c = get_cursor_pos_ptr();
+ // 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;
@@ -3334,8 +3342,9 @@ again:
* on an empty area. */
curwin->w_cursor = start_pos;
oap->inclusive = false;
- } else
- oap->inclusive = true;
+ } else {
+ oap->inclusive = is_inclusive;
+ }
}
retval = OK;
diff --git a/src/nvim/testdir/test53.in b/src/nvim/testdir/test53.in
index 8ca9c9ed29..7c35b2e853 100644
--- a/src/nvim/testdir/test53.in
+++ b/src/nvim/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/nvim/testdir/test53.ok b/src/nvim/testdir/test53.ok
index 0c0b9ded16..05206972a4 100644
--- a/src/nvim/testdir/test53.ok
+++ b/src/nvim/testdir/test53.ok
@@ -11,6 +11,7 @@ voo "zzzzzzzzzzzzzzzzzzzzzzzzzzzzsd
-<b></b>-
-<b>asdfasdf</b>-
--
+-<b></b>
</begin>
b
bc
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 72d61ff023..75c21d4b37 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -341,7 +341,7 @@ static int included_patches[] = {
// 658,
// 657 NA
// 656,
- // 655,
+ 655,
// 654,
653,
// 652 NA