diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2014-12-14 20:35:28 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2014-12-14 20:35:28 -0500 |
commit | 6a193a0e2e22ae31dd04957174b1c958d1b792ec (patch) | |
tree | 6de193245f5c4a60d273fabc007caaef97069634 | |
parent | a5edc5f2572d6d63f7f7a32ae6ec7bcabe1472b6 (diff) | |
parent | b8123cb4af70b9f241364e717e4d3063e6cda37d (diff) | |
download | rneovim-6a193a0e2e22ae31dd04957174b1c958d1b792ec.tar.gz rneovim-6a193a0e2e22ae31dd04957174b1c958d1b792ec.tar.bz2 rneovim-6a193a0e2e22ae31dd04957174b1c958d1b792ec.zip |
Merge pull request #1666 from elmart/vim-patch-7.4.543
vim-patch:7.4.543.
-rw-r--r-- | src/nvim/ex_cmds.c | 12 | ||||
-rw-r--r-- | src/nvim/search.c | 2 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 1c6aa536b3..049934d680 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3604,9 +3604,10 @@ void do_sub(exarg_T *eap) eap->flags = EXFLAG_PRINT; } - linenr_T joined_lines_count = eap->line2 < curbuf->b_ml.ml_line_count - ? eap->line2 - eap->line1 + 2 - : eap->line2 - eap->line1 + 1; + // The number of lines joined is the number of lines in the range + linenr_T joined_lines_count = eap->line2 - eap->line1 + 1 + // plus one extra line if not at the end of file. + + eap->line2 < curbuf->b_ml.ml_line_count ? 1 : 0; if (joined_lines_count > 1) { do_join(joined_lines_count, FALSE, TRUE, FALSE, true); sub_nsubs = joined_lines_count - 1; @@ -3615,6 +3616,11 @@ void do_sub(exarg_T *eap) ex_may_print(eap); } + if (!cmdmod.keeppatterns) { + save_re_pat(RE_SUBST, pat, p_magic); + } + add_to_history(HIST_SEARCH, pat, TRUE, NUL); + return; } diff --git a/src/nvim/search.c b/src/nvim/search.c index 3055729bf8..ef98944a06 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -246,7 +246,7 @@ char_u *reverse_text(char_u *s) FUNC_ATTR_NONNULL_RET return rev; } -static void save_re_pat(int idx, char_u *pat, int magic) +void save_re_pat(int idx, char_u *pat, int magic) { if (spats[idx].pat != pat) { free(spats[idx].pat); diff --git a/src/nvim/version.c b/src/nvim/version.c index f643fa5c85..f0f00deea4 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -187,7 +187,7 @@ static int included_patches[] = { //546, //545, //544, - //543, + 543, //542, //541, //540, |