aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nvim/buffer.c12
-rw-r--r--src/nvim/digraph.c5
-rw-r--r--src/nvim/edit.c6
-rw-r--r--src/nvim/eval.c5
-rw-r--r--src/nvim/ex_cmds.c5
-rw-r--r--src/nvim/ex_docmd.c16
-rw-r--r--src/nvim/ex_getln.c2
-rw-r--r--src/nvim/file_search.c3
-rw-r--r--src/nvim/fileio.c10
-rw-r--r--src/nvim/getchar.c4
-rw-r--r--src/nvim/hardcopy.c3
-rw-r--r--src/nvim/if_cscope.c3
-rw-r--r--src/nvim/main.c7
-rw-r--r--src/nvim/mark.c5
-rw-r--r--src/nvim/memfile.c2
-rw-r--r--src/nvim/message.c4
-rw-r--r--src/nvim/misc1.c13
-rw-r--r--src/nvim/normal.c5
-rw-r--r--src/nvim/ops.c12
-rw-r--r--src/nvim/option.c3
-rw-r--r--src/nvim/path.c8
-rw-r--r--src/nvim/quickfix.c3
-rw-r--r--src/nvim/screen.c3
-rw-r--r--src/nvim/search.c5
-rw-r--r--src/nvim/spell.c5
-rw-r--r--src/nvim/syntax.c3
-rw-r--r--src/nvim/tag.c8
-rw-r--r--src/nvim/term.c7
-rw-r--r--src/nvim/ui.c39
29 files changed, 98 insertions, 108 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 6b5b97fe67..7bf8ff2c5c 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -73,6 +73,8 @@
#include "nvim/undo.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
+#include "nvim/os/time.h"
+#include "nvim/os/input.h"
#define HAVE_BUFLIST_MATCH
@@ -716,7 +718,7 @@ do_bufdel (
} else /* addr_count == 1 */
bnr = end_bnr;
- for (; !got_int; ui_breakcheck()) {
+ for (; !got_int; os_breakcheck()) {
/*
* delete the current buffer last, otherwise when the
* current buffer is deleted, the next buffer becomes
@@ -1422,7 +1424,7 @@ buflist_new (
EMSG(_("W14: Warning: List of file names overflow"));
if (emsg_silent == 0) {
out_flush();
- ui_delay(3000L, true); /* make sure it is noticed */
+ os_delay(3000L, true); /* make sure it is noticed */
}
top_file_num = 1;
}
@@ -2162,7 +2164,7 @@ void buflist_list(exarg_T *eap)
: (int64_t)buflist_findlnum(buf));
msg_outtrans(IObuff);
out_flush(); /* output one line at a time */
- ui_breakcheck();
+ os_breakcheck();
}
}
@@ -3801,7 +3803,7 @@ do_arg_all (
++autocmd_no_leave;
use_firstwin = FALSE;
}
- ui_breakcheck();
+ os_breakcheck();
/* When ":tab" was used open a new tab for a new window repeatedly. */
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
@@ -3965,7 +3967,7 @@ void ex_buffer_all(exarg_T *eap)
#endif
}
- ui_breakcheck();
+ os_breakcheck();
if (got_int) {
(void)vgetc(); /* only break the file loading, not the rest */
break;
diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c
index ffba7d4276..eb3b35bfb9 100644
--- a/src/nvim/digraph.c
+++ b/src/nvim/digraph.c
@@ -24,6 +24,7 @@
#include "nvim/screen.h"
#include "nvim/strings.h"
#include "nvim/ui.h"
+#include "nvim/os/input.h"
typedef int result_T;
@@ -1659,13 +1660,13 @@ void listdigraphs(void)
printdigraph(&tmp);
}
dp++;
- ui_breakcheck();
+ os_breakcheck();
}
dp = (digr_T *)user_digraphs.ga_data;
for (int i = 0; i < user_digraphs.ga_len && !got_int; ++i) {
printdigraph(dp);
- ui_breakcheck();
+ os_breakcheck();
dp++;
}
// clear screen, because some digraphs may be wrong, in which case we messed
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index b9ecbc71fe..7fdf02ca56 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -59,6 +59,8 @@
#include "nvim/undo.h"
#include "nvim/window.h"
#include "nvim/os/event.h"
+#include "nvim/os/input.h"
+#include "nvim/os/time.h"
/*
* definitions used for CTRL-X submode
@@ -1761,7 +1763,7 @@ static int has_compl_option(int dict_opt)
vim_beep();
setcursor();
out_flush();
- ui_delay(2000L, false);
+ os_delay(2000L, false);
}
return FALSE;
}
@@ -2005,7 +2007,7 @@ ins_compl_add (
compl_T *match;
int dir = (cdir == 0 ? compl_direction : cdir);
- ui_breakcheck();
+ os_breakcheck();
if (got_int)
return FAIL;
if (len < 0)
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 0a57b4ceb2..206f487471 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -90,6 +90,7 @@
#include "nvim/api/vim.h"
#include "nvim/os/dl.h"
#include "nvim/os/event.h"
+#include "nvim/os/input.h"
#define DICT_MAXNEST 100 /* maximum nesting of lists and dicts */
@@ -17270,7 +17271,7 @@ void ex_function(exarg_T *eap)
msg_putchar(' ');
msg_prt_line(FUNCLINE(fp, j), FALSE);
out_flush(); /* show a line at a time */
- ui_breakcheck();
+ os_breakcheck();
}
if (!got_int) {
msg_putchar('\n');
@@ -19295,7 +19296,7 @@ void ex_oldfiles(exarg_T *eap)
msg_outtrans(get_tv_string(&li->li_tv));
msg_putchar('\n');
out_flush(); /* output one line at a time */
- ui_breakcheck();
+ os_breakcheck();
}
/* Assume "got_int" was set to truncate the listing. */
got_int = FALSE;
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index f33a96cc50..68bee9ed17 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -67,6 +67,7 @@
#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 +1111,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) {
@@ -4560,7 +4561,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;
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 3e9b889253..3967c916bb 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -67,6 +67,8 @@
#include "nvim/version.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
+#include "nvim/os/input.h"
+#include "nvim/os/time.h"
#include "nvim/ex_cmds_defs.h"
static int quitmore = 0;
@@ -4337,7 +4339,7 @@ static void uc_list(char_u *name, size_t name_len)
if (p_verbose > 0)
last_set_msg(cmd->uc_scriptID);
out_flush();
- ui_breakcheck();
+ os_breakcheck();
if (got_int)
break;
}
@@ -5459,7 +5461,7 @@ static void ex_print(exarg_T *eap)
if (curbuf->b_ml.ml_flags & ML_EMPTY)
EMSG(_(e_emptybuf));
else {
- for (; !got_int; ui_breakcheck()) {
+ for (; !got_int; os_breakcheck()) {
print_line(eap->line1,
(eap->cmdidx == CMD_number || eap->cmdidx == CMD_pound
|| (eap->flags & EXFLAG_NR)),
@@ -5586,7 +5588,7 @@ void alist_set(alist_T *al, int count, char_u **files, int use_curbuf, int *fnum
buf_set_name(fnum_list[i], files[i]);
alist_add(al, files[i], use_curbuf ? 2 : 1);
- ui_breakcheck();
+ os_breakcheck();
}
free(files);
}
@@ -5842,7 +5844,7 @@ static void ex_tabs(exarg_T *eap)
vim_snprintf((char *)IObuff, IOSIZE, _("Tab page %d"), tabcount++);
msg_outtrans_attr(IObuff, hl_attr(HLF_T));
out_flush(); /* output one line at a time */
- ui_breakcheck();
+ os_breakcheck();
FOR_ALL_WINDOWS_IN_TAB(wp, tp) {
if (got_int) {
@@ -5861,7 +5863,7 @@ static void ex_tabs(exarg_T *eap)
IObuff, IOSIZE, TRUE);
msg_outtrans(IObuff);
out_flush(); /* output one line at a time */
- ui_breakcheck();
+ os_breakcheck();
}
}
}
@@ -6408,8 +6410,8 @@ void do_sleep(long msec)
cursor_on();
out_flush();
for (done = 0; !got_int && done < msec; done += 1000L) {
- ui_delay(msec - done > 1000L ? 1000L : msec - done, true);
- ui_breakcheck();
+ os_delay(msec - done > 1000L ? 1000L : msec - done, true);
+ os_breakcheck();
}
}
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 2be3757821..a19423532d 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -1946,7 +1946,7 @@ redraw:
msg_col = 0;
if (msg_row < Rows - 1)
++msg_row;
- emsg_on_display = FALSE; /* don't want ui_delay() */
+ emsg_on_display = FALSE; /* don't want os_delay() */
if (got_int)
ga_clear(&line_ga);
diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c
index 955b0b0a68..8ccdf33980 100644
--- a/src/nvim/file_search.c
+++ b/src/nvim/file_search.c
@@ -65,6 +65,7 @@
#include "nvim/ui.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
+#include "nvim/os/input.h"
#include "nvim/os/fs_defs.h"
static char_u *ff_expand_buffer = NULL; /* used for expanding filenames */
@@ -607,7 +608,7 @@ char_u *vim_findfile(void *search_ctx_arg)
/* downward search loop */
for (;; ) {
/* check if user user wants to stop the search*/
- ui_breakcheck();
+ os_breakcheck();
if (got_int)
break;
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 97a357bff7..f2c3afe9a6 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -57,6 +57,8 @@
#include "nvim/undo.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
+#include "nvim/os/time.h"
+#include "nvim/os/input.h"
#if defined(HAVE_UTIME) && defined(HAVE_UTIME_H)
# include <utime.h> /* for struct utimbuf */
@@ -1704,7 +1706,7 @@ rewind_retry:
}
}
linerest = (long)(ptr - line_start);
- ui_breakcheck();
+ os_breakcheck();
}
failed:
@@ -2927,7 +2929,7 @@ buf_write (
"E506: Can't write to backup file (add ! to override)");
break;
}
- ui_breakcheck();
+ os_breakcheck();
if (got_int) {
errmsg = (char_u *)_(e_interr);
break;
@@ -3377,7 +3379,7 @@ restore_backup:
s = buffer;
len = 0;
- ui_breakcheck();
+ os_breakcheck();
if (got_int) {
end = 0; /* Interrupted, break loop */
break;
@@ -4958,7 +4960,7 @@ buf_check_timestamp (
if (emsg_silent == 0) {
out_flush();
/* give the user some time to think about it */
- ui_delay(1000L, true);
+ os_delay(1000L, true);
/* don't redraw and erase the message */
redraw_cmdline = FALSE;
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index a3c87806b2..63ae5b4d4f 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1702,14 +1702,14 @@ static int vgetorpeek(int advance)
*/
for (;; ) {
/*
- * ui_breakcheck() is slow, don't use it too often when
+ * os_breakcheck() is slow, don't use it too often when
* inside a mapping. But call it each time for typed
* characters.
*/
if (typebuf.tb_maplen)
line_breakcheck();
else
- ui_breakcheck(); /* check for CTRL-C */
+ os_breakcheck(); /* check for CTRL-C */
keylen = 0;
if (got_int) {
/* flush all input */
diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c
index 1d15e30921..58fee17ed1 100644
--- a/src/nvim/hardcopy.c
+++ b/src/nvim/hardcopy.c
@@ -43,6 +43,7 @@
#include "nvim/tempfile.h"
#include "nvim/ui.h"
#include "nvim/os/os.h"
+#include "nvim/os/input.h"
/*
* To implement printing on a platform, the following functions must be
@@ -724,7 +725,7 @@ void ex_hardcopy(exarg_T *eap)
*/
/* Check for interrupt character every page. */
- ui_breakcheck();
+ os_breakcheck();
if (got_int || settings.user_abort)
goto print_fail;
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index 667e6512f3..dc7486f332 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -32,6 +32,7 @@
#include "nvim/ui.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
+#include "nvim/os/input.h"
#include <sys/types.h>
#include <sys/stat.h>
@@ -1735,7 +1736,7 @@ static void cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
if (msg_col)
msg_putchar('\n');
- ui_breakcheck();
+ os_breakcheck();
if (got_int) {
got_int = FALSE; /* don't print any more matches */
break;
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 4447c404d5..68ae000c35 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -57,6 +57,7 @@
#include "nvim/ui.h"
#include "nvim/version.h"
#include "nvim/window.h"
+#include "nvim/os/time.h"
#include "nvim/os/input.h"
#include "nvim/os/os.h"
#include "nvim/os/signal.h"
@@ -1608,7 +1609,7 @@ static void check_tty(mparm_T *parmp)
mch_errmsg(_("Vim: Warning: Input is not from a terminal\n"));
out_flush();
if (scriptin[0] == NULL)
- ui_delay(2000L, true);
+ os_delay(2000L, true);
TIME_MSG("Warning delay");
}
}
@@ -1742,7 +1743,7 @@ static void create_windows(mparm_T *parmp)
#endif
dorewind = TRUE; /* start again */
}
- ui_breakcheck();
+ os_breakcheck();
if (got_int) {
(void)vgetc(); /* only break the file loading, not the rest */
break;
@@ -1832,7 +1833,7 @@ static void edit_buffers(mparm_T *parmp)
arg_had_last = TRUE;
++arg_idx;
}
- ui_breakcheck();
+ os_breakcheck();
if (got_int) {
(void)vgetc(); /* only break the file loading, not the rest */
break;
diff --git a/src/nvim/mark.c b/src/nvim/mark.c
index 120645cfe6..9971460537 100644
--- a/src/nvim/mark.c
+++ b/src/nvim/mark.c
@@ -40,6 +40,7 @@
#include "nvim/term.h"
#include "nvim/ui.h"
#include "nvim/os/os.h"
+#include "nvim/os/input.h"
/*
* This file contains routines to maintain and manipulate marks.
@@ -811,7 +812,7 @@ void ex_jumps(exarg_T *eap)
curwin->w_jumplist[i].fmark.fnum == curbuf->b_fnum
? hl_attr(HLF_D) : 0);
free(name);
- ui_breakcheck();
+ os_breakcheck();
}
out_flush();
}
@@ -845,7 +846,7 @@ void ex_changes(exarg_T *eap)
name = mark_line(&curbuf->b_changelist[i], 17);
msg_outtrans_attr(name, hl_attr(HLF_D));
free(name);
- ui_breakcheck();
+ os_breakcheck();
}
out_flush();
}
diff --git a/src/nvim/memfile.c b/src/nvim/memfile.c
index bcb7c22a21..9bad7a4cf4 100644
--- a/src/nvim/memfile.c
+++ b/src/nvim/memfile.c
@@ -459,7 +459,7 @@ int mf_sync(memfile_T *mfp, int flags)
if (os_char_avail())
break;
} else {
- ui_breakcheck();
+ os_breakcheck();
}
if (got_int)
break;
diff --git a/src/nvim/message.c b/src/nvim/message.c
index 6b17c00417..2c1fe313fe 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -44,6 +44,8 @@
#include "nvim/term.h"
#include "nvim/ui.h"
#include "nvim/os/os.h"
+#include "nvim/os/input.h"
+#include "nvim/os/time.h"
/*
* To be able to scroll back at the "more" and "hit-enter" prompts we need to
@@ -877,7 +879,7 @@ void wait_return(int redraw)
|| c == K_X1MOUSE
|| c == K_X2MOUSE))
);
- ui_breakcheck();
+ os_breakcheck();
/*
* Avoid that the mouse-up event causes visual mode to start.
*/
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index cef7ea0627..230e198121 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -59,6 +59,7 @@
#include "nvim/os/os.h"
#include "nvim/os/shell.h"
#include "nvim/os/input.h"
+#include "nvim/os/time.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "misc1.c.generated.h"
@@ -1841,7 +1842,7 @@ void changed(void)
* and don't let the emsg() set msg_scroll. */
if (need_wait_return && emsg_silent == 0) {
out_flush();
- ui_delay(2000L, true);
+ os_delay(2000L, true);
wait_return(TRUE);
msg_scroll = save_msg_scroll;
}
@@ -2262,7 +2263,7 @@ change_warning (
(void)msg_end();
if (msg_silent == 0 && !silent_mode) {
out_flush();
- ui_delay(1000L, true); /* give the user time to think about it */
+ os_delay(1000L, true); /* give the user time to think about it */
}
curbuf->b_did_warn = true;
redraw_cmdline = FALSE; /* don't redraw and erase the message */
@@ -3363,8 +3364,8 @@ void preserve_exit(void)
/*
* Check for CTRL-C pressed, but only once in a while.
- * Should be used instead of ui_breakcheck() for functions that check for
- * each line in the file. Calling ui_breakcheck() each time takes too much
+ * Should be used instead of os_breakcheck() for functions that check for
+ * each line in the file. Calling os_breakcheck() each time takes too much
* time, because it can be a system call.
*/
@@ -3378,7 +3379,7 @@ void line_breakcheck(void)
{
if (++breakcheck_count >= BREAKCHECK_SKIP) {
breakcheck_count = 0;
- ui_breakcheck();
+ os_breakcheck();
}
}
@@ -3389,7 +3390,7 @@ void fast_breakcheck(void)
{
if (++breakcheck_count >= BREAKCHECK_SKIP * 10) {
breakcheck_count = 0;
- ui_breakcheck();
+ os_breakcheck();
}
}
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index f58e044c2c..d1eb302448 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -60,6 +60,7 @@
#include "nvim/undo.h"
#include "nvim/window.h"
#include "nvim/os/event.h"
+#include "nvim/os/time.h"
/*
* The Visual area is remembered for reselection.
@@ -1008,8 +1009,8 @@ getcount:
cursor_on();
out_flush();
if (msg_scroll || emsg_on_display)
- ui_delay(1000L, true); /* wait at least one second */
- ui_delay(3000L, false); /* wait up to three seconds */
+ os_delay(1000L, true); /* wait at least one second */
+ os_delay(3000L, false); /* wait up to three seconds */
State = save_State;
msg_scroll = false;
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 5ef605bb3b..edec3518cb 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -48,7 +48,7 @@
#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/window.h"
-#include "nvim/api/private/helpers.h"
+#include "nvim/os/input.h"
/*
* Registers:
@@ -1112,7 +1112,7 @@ insert_reg (
* register a and then, in insert mode, doing CTRL-R a.
* If you hit CTRL-C, the loop will be broken here.
*/
- ui_breakcheck();
+ os_breakcheck();
if (got_int)
return FAIL;
@@ -1296,7 +1296,7 @@ cmdline_paste_reg (
/* Check for CTRL-C, in case someone tries to paste a few thousand
* lines and gets bored. */
- ui_breakcheck();
+ os_breakcheck();
if (got_int)
return FAIL;
}
@@ -3254,7 +3254,7 @@ void ex_display(exarg_T *eap)
MSG_PUTS_ATTR("^J", attr);
out_flush(); /* show one line at a time */
}
- ui_breakcheck();
+ os_breakcheck();
}
/*
@@ -3339,7 +3339,7 @@ dis_msg (
} else
msg_outtrans_len(p++, 1);
}
- ui_breakcheck();
+ os_breakcheck();
}
/*
@@ -5079,7 +5079,7 @@ void cursor_pos_info(void)
for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum) {
/* Check for a CTRL-C every 100000 characters. */
if (byte_count > last_check) {
- ui_breakcheck();
+ os_breakcheck();
if (got_int)
return;
last_check = byte_count + 100000L;
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 830a30204b..bdb9e14e7c 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -79,6 +79,7 @@
#include "nvim/undo.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
+#include "nvim/os/input.h"
/*
* The options that are local to a window or buffer have "indir" set to one of
@@ -6123,7 +6124,7 @@ showoptions (
col += INC;
}
out_flush();
- ui_breakcheck();
+ os_breakcheck();
}
}
free(items);
diff --git a/src/nvim/path.c b/src/nvim/path.c
index ff97b7774a..e8d31f3f73 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -31,7 +31,7 @@
#include "nvim/strings.h"
#include "nvim/tag.h"
#include "nvim/types.h"
-#include "nvim/ui.h"
+#include "nvim/os/input.h"
#include "nvim/window.h"
#define URL_SLASH 1 /* path_is_url() has found "://" */
@@ -449,7 +449,7 @@ unix_expandpath (
/* Expanding "**" may take a long time, check for CTRL-C. */
if (stardepth > 0) {
- ui_breakcheck();
+ os_breakcheck();
if (got_int)
return 0;
}
@@ -850,7 +850,7 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern)
STRMOVE(path + STRLEN(path), short_name);
}
}
- ui_breakcheck();
+ os_breakcheck();
}
/* Shorten filenames in /in/current/directory/{filename} */
@@ -879,7 +879,7 @@ static void uniquefy_paths(garray_T *gap, char_u *pattern)
free(fnames[i]);
fnames[i] = rel_path;
sort_again = TRUE;
- ui_breakcheck();
+ os_breakcheck();
}
free(curdir);
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 3de7f73339..e88fb6f49e 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -52,6 +52,7 @@
#include "nvim/ui.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
+#include "nvim/os/input.h"
struct dir_stack_T {
@@ -1791,7 +1792,7 @@ void qf_list(exarg_T *eap)
qfp = qfp->qf_next;
++i;
- ui_breakcheck();
+ os_breakcheck();
}
}
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 3cbdbdd81f..c94a0bb16d 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -133,6 +133,7 @@
#include "nvim/undo.h"
#include "nvim/version.h"
#include "nvim/window.h"
+#include "nvim/os/time.h"
#define MB_FILLER_CHAR '<' /* character used when a double-width character
* doesn't fit. */
@@ -6255,7 +6256,7 @@ void check_for_delay(int check_msg_scroll)
&& !did_wait_return
&& emsg_silent == 0) {
out_flush();
- ui_delay(1000L, true);
+ os_delay(1000L, true);
emsg_on_display = FALSE;
if (check_msg_scroll)
msg_scroll = FALSE;
diff --git a/src/nvim/search.c b/src/nvim/search.c
index bd1811c7fb..78d9dcbccb 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -48,6 +48,7 @@
#include "nvim/term.h"
#include "nvim/ui.h"
#include "nvim/window.h"
+#include "nvim/os/time.h"
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -2053,9 +2054,9 @@ showmatch (
* available.
*/
if (vim_strchr(p_cpo, CPO_SHOWMATCH) != NULL)
- ui_delay(p_mat * 100L, true);
+ os_delay(p_mat * 100L, true);
else if (!char_avail())
- ui_delay(p_mat * 100L, false);
+ os_delay(p_mat * 100L, false);
curwin->w_cursor = save_cursor; /* restore cursor position */
p_so = save_so;
p_siso = save_siso;
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index ea5ce7ee0d..cb0990311a 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -328,6 +328,7 @@
#include "nvim/ui.h"
#include "nvim/undo.h"
#include "nvim/os/os.h"
+#include "nvim/os/input.h"
#ifndef UNIX // it's in os_unix_defs.h for Unix
# include <time.h> // for time_t
@@ -9018,7 +9019,7 @@ static void spell_suggest_intern(suginfo_T *su, bool interactive)
// When CTRL-C was hit while searching do show the results. Only clear
// got_int when using a command, not for spellsuggest().
- ui_breakcheck();
+ os_breakcheck();
if (interactive && got_int) {
(void)vgetc();
got_int = FALSE;
@@ -10616,7 +10617,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
// Don't check for CTRL-C too often, it takes time.
if (--breakcheckcount == 0) {
- ui_breakcheck();
+ os_breakcheck();
breakcheckcount = 1000;
}
}
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 6c5c0f37b1..7d2a9d8624 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -46,6 +46,7 @@
#include "nvim/term.h"
#include "nvim/ui.h"
#include "nvim/os/os.h"
+#include "nvim/os/time.h"
/*
* Structure that stores information about a highlight group.
@@ -7606,7 +7607,7 @@ static void highlight_list_two(int cnt, int attr)
msg_puts_attr((char_u *)&("N \bI \b! \b"[cnt / 11]), attr);
msg_clr_eos();
out_flush();
- ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, false);
+ os_delay(cnt == 99 ? 40L : (long)cnt * 50L, false);
}
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 6ac6dc5cd2..8c160fea4f 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -52,6 +52,8 @@
#include "nvim/ui.h"
#include "nvim/window.h"
#include "nvim/os/os.h"
+#include "nvim/os/time.h"
+#include "nvim/os/input.h"
/*
* Structure to hold pointers to various items in a tag line.
@@ -672,7 +674,7 @@ do_tag (
}
if (msg_col)
msg_putchar('\n');
- ui_breakcheck();
+ os_breakcheck();
}
if (got_int)
got_int = FALSE; /* only stop the listing */
@@ -881,7 +883,7 @@ do_tag (
give_warning(IObuff, ic);
if (ic && !msg_scrolled && msg_silent == 0) {
out_flush();
- ui_delay(1000L, true);
+ os_delay(1000L, true);
}
}
@@ -2493,7 +2495,7 @@ jumpto_tag (
MSG(_("E435: Couldn't find tag, just guessing!"));
if (!msg_scrolled && msg_silent == 0) {
out_flush();
- ui_delay(1000L, true);
+ os_delay(1000L, true);
}
}
retval = OK;
diff --git a/src/nvim/term.c b/src/nvim/term.c
index 263b81fc3a..3d1053bd2f 100644
--- a/src/nvim/term.c
+++ b/src/nvim/term.c
@@ -54,6 +54,7 @@
#include "nvim/window.h"
#include "nvim/os/os.h"
#include "nvim/os/time.h"
+#include "nvim/os/input.h"
#ifdef HAVE_TGETENT
# ifdef HAVE_TERMIOS_H
@@ -1330,7 +1331,7 @@ int set_termname(char_u *term)
if (emsg_silent == 0) {
screen_start(); /* don't know where cursor is now */
out_flush();
- ui_delay(2000L, true);
+ os_delay(2000L, true);
}
set_string_option_direct((char_u *)"term", -1, term,
OPT_FREE, 0);
@@ -2302,7 +2303,7 @@ void set_shellsize(int width, int height, int mustset)
Rows = height;
Columns = width;
check_shellsize();
- ui_set_shellsize(mustset);
+ mch_set_shellsize();
} else
check_shellsize();
@@ -4111,7 +4112,7 @@ void show_termcodes(void)
col += INC3;
}
out_flush();
- ui_breakcheck();
+ os_breakcheck();
}
}
free(items);
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 8495744ec2..67ed37e0b8 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -63,15 +63,6 @@ void ui_write(char_u *s, int len)
}
/*
- * Delay for the given number of milliseconds. If ignoreinput is FALSE then we
- * cancel the delay if a key is hit.
- */
-void ui_delay(long msec, bool ignoreinput)
-{
- os_delay(msec, ignoreinput);
-}
-
-/*
* If the machine has job control, use it to suspend the program,
* otherwise fake it by starting a new shell.
* When running the GUI iconify the window.
@@ -103,34 +94,6 @@ int ui_get_shellsize(void)
}
/*
- * Set the size of the Vim shell according to Rows and Columns, if possible.
- * The gui_set_shellsize() or mch_set_shellsize() function will try to set the
- * new size. If this is not possible, it will adjust Rows and Columns.
- */
-void
-ui_set_shellsize(int mustset)
-{
- mch_set_shellsize();
-}
-
-void ui_breakcheck(void)
-{
- os_breakcheck();
-}
-
-/*****************************************************************************
- * Functions for copying and pasting text between applications.
- * This is always included in a GUI version, but may also be included when the
- * clipboard and mouse is available to a terminal version such as xterm.
- * Note: there are some more functions in ops.c that handle selection stuff.
- *
- * Also note that the majority of functions here deal with the X 'primary'
- * (visible - for Visual mode use) selection, and only that. There are no
- * versions of these for the 'clipboard' selection, as Visual mode has no use
- * for them.
- */
-
-/*
* Exit because of an input read error.
*/
void read_error_exit(void)
@@ -147,8 +110,6 @@ void read_error_exit(void)
void ui_cursor_shape(void)
{
term_cursor_shape();
-
-
conceal_check_cursur_line();
}