aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2014-12-02 19:04:30 +0100
committerEliseo Martínez <eliseomarmol@gmail.com>2014-12-02 19:04:30 +0100
commitd146b7c7ca5fbf029e8d8b30e38414a91556349a (patch)
tree81e38c18b76a116035dfa8aabedf1bb0bd72ae44 /src
parent26b2f9ab11a3b50a5066c4509688e989bb4e8e92 (diff)
downloadrneovim-d146b7c7ca5fbf029e8d8b30e38414a91556349a.tar.gz
rneovim-d146b7c7ca5fbf029e8d8b30e38414a91556349a.tar.bz2
rneovim-d146b7c7ca5fbf029e8d8b30e38414a91556349a.zip
Fix newline substitution: Adapt to upstream patch.
Fix previous changes to be compatible with agreed changes to upstream vim (https://code.google.com/p/vim/issues/detail?id=287).
Diffstat (limited to 'src')
-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;
}