aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/search.c
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johanhelsing@gmail.com>2015-11-22 02:29:14 +0100
committerJohan Klokkhammer Helsing <johanhelsing@gmail.com>2015-11-22 02:52:50 +0100
commitcfa2107e33e98c35a2f08236ef6816fbae7cc8f1 (patch)
tree0bd3a12729e83c4b97dacd19b4f5dafadd2bd1ab /src/nvim/search.c
parent1fbb56795d16783f9a97e25e3b71ab3ac2a644dc (diff)
downloadrneovim-cfa2107e33e98c35a2f08236ef6816fbae7cc8f1.tar.gz
rneovim-cfa2107e33e98c35a2f08236ef6816fbae7cc8f1.tar.bz2
rneovim-cfa2107e33e98c35a2f08236ef6816fbae7cc8f1.zip
vim-patch:7.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) https://github.com/vim/vim/commit/b6c2735c56f1541159e1ad95c3f17a52b3a94f1d
Diffstat (limited to 'src/nvim/search.c')
-rw-r--r--src/nvim/search.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c
index a44b0e00c7..d742a7a341 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -926,7 +926,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 */
@@ -3201,6 +3201,7 @@ current_tagblock (
int do_include = include;
bool save_p_ws = p_ws;
int retval = FAIL;
+ int is_inclusive = true;
p_ws = false;
@@ -3295,9 +3296,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;
@@ -3342,8 +3350,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;