aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index f33a96cc50..0829049e4d 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -62,11 +62,11 @@
#include "nvim/tag.h"
#include "nvim/tempfile.h"
#include "nvim/term.h"
-#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
#include "nvim/os/shell.h"
+#include "nvim/os/input.h"
/*
* Struct to hold the sign properties.
@@ -1110,7 +1110,7 @@ do_filter (
/* When interrupting the shell command, it may still have produced some
* useful output. Reset got_int here, so that readfile() won't cancel
* reading. */
- ui_breakcheck();
+ os_breakcheck();
got_int = FALSE;
if (do_out) {
@@ -3602,8 +3602,13 @@ void do_sub(exarg_T *eap)
eap->flags = EXFLAG_PRINT;
}
- do_join(eap->line2 - eap->line1 + 1, FALSE, TRUE, FALSE, true);
- sub_nlines = sub_nsubs = eap->line2 - eap->line1 + 1;
+ 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) {
+ do_join(joined_lines_count, FALSE, TRUE, FALSE, true);
+ }
+ sub_nlines = sub_nsubs = joined_lines_count - 1;
do_sub_msg(false);
ex_may_print(eap);
@@ -4560,7 +4565,7 @@ void global_exe(char_u *cmd)
do_cmdline((char_u *)"p", NULL, NULL, DOCMD_NOWAIT);
else
do_cmdline(cmd, NULL, NULL, DOCMD_NOWAIT);
- ui_breakcheck();
+ os_breakcheck();
}
global_busy = 0;