diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-12-09 21:00:04 +0100 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2021-12-09 21:00:04 +0100 |
commit | 2ec0e0a868ba20373ef4cd2d2540db7e829ddc56 (patch) | |
tree | 17f4f0bf638ba8b4d604392f260fd686b527af95 /src/nvim/misc1.c | |
parent | 2fe60905f6e12b3cae5c9ca2d1456fe23501be61 (diff) | |
download | rneovim-2ec0e0a868ba20373ef4cd2d2540db7e829ddc56.tar.gz rneovim-2ec0e0a868ba20373ef4cd2d2540db7e829ddc56.tar.bz2 rneovim-2ec0e0a868ba20373ef4cd2d2540db7e829ddc56.zip |
refactor(misc1): move line_breakcheck family of functions to os/input.c
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r-- | src/nvim/misc1.c | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 872a2c58e3..dd753a2de6 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -858,47 +858,6 @@ void preserve_exit(void) getout(1); } -/* - * Check for CTRL-C pressed, but only once in a while. - * 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. - */ - -#ifndef BREAKCHECK_SKIP -# define BREAKCHECK_SKIP 1000 -#endif - -static int breakcheck_count = 0; - -void line_breakcheck(void) -{ - if (++breakcheck_count >= BREAKCHECK_SKIP) { - breakcheck_count = 0; - os_breakcheck(); - } -} - -/* - * Like line_breakcheck() but check 10 times less often. - */ -void fast_breakcheck(void) -{ - if (++breakcheck_count >= BREAKCHECK_SKIP * 10) { - breakcheck_count = 0; - os_breakcheck(); - } -} - -// Like line_breakcheck() but check 100 times less often. -void veryfast_breakcheck(void) -{ - if (++breakcheck_count >= BREAKCHECK_SKIP * 100) { - breakcheck_count = 0; - os_breakcheck(); - } -} - /// os_call_shell() wrapper. Handles 'verbose', :profile, and v:shell_error. /// Invalidates cached tags. /// |