aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2014-12-02 15:15:37 -0500
committerJustin M. Keyes <justinkz@gmail.com>2014-12-02 15:15:37 -0500
commit81394c9d73a0dc579dd82d3bb83fd36711299ea1 (patch)
tree81e38c18b76a116035dfa8aabedf1bb0bd72ae44 /src/nvim/ex_cmds.c
parent26b2f9ab11a3b50a5066c4509688e989bb4e8e92 (diff)
parentd146b7c7ca5fbf029e8d8b30e38414a91556349a (diff)
downloadrneovim-81394c9d73a0dc579dd82d3bb83fd36711299ea1.tar.gz
rneovim-81394c9d73a0dc579dd82d3bb83fd36711299ea1.tar.bz2
rneovim-81394c9d73a0dc579dd82d3bb83fd36711299ea1.zip
Merge pull request #1596 from elmart/fix-newline-subst
Fix newline substitution: Adapt to upstream patch.
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 7c6e046133..44caa67847 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -3606,12 +3606,13 @@ void do_sub(exarg_T *eap)
linenr_T joined_lines_count = eap->line2 < curbuf->b_ml.ml_line_count
? eap->line2 - eap->line1 + 2
: eap->line2 - eap->line1 + 1;
- if (joined_lines_count >= 2) {
+ if (joined_lines_count > 1) {
do_join(joined_lines_count, FALSE, TRUE, FALSE, true);
+ sub_nsubs = joined_lines_count - 1;
+ sub_nlines = 1;
+ do_sub_msg(false);
+ ex_may_print(eap);
}
- sub_nlines = sub_nsubs = joined_lines_count - 1;
- do_sub_msg(false);
- ex_may_print(eap);
return;
}