diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/getchar.c | 18 | ||||
-rw-r--r-- | src/nvim/memline.c | 20 |
2 files changed, 18 insertions, 20 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index 3541ba7cc8..e2566c8c66 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -1328,10 +1328,8 @@ int using_script(void) return scriptin[curscript] != NULL; } -/* - * This function is called just before doing a blocking wait. Thus after - * waiting 'updatetime' for a character to arrive. - */ +/// This function is called just before doing a blocking wait. Thus after +/// waiting 'updatetime' for a character to arrive. void before_blocking(void) { updatescript(0); @@ -1340,13 +1338,11 @@ void before_blocking(void) } } -/* - * updatescipt() is called when a character can be written into the script file - * or when we have waited some time for a character (c == 0) - * - * All the changed memfiles are synced if c == 0 or when the number of typed - * characters reaches 'updatecount' and 'updatecount' is non-zero. - */ +/// updatescript() is called when a character can be written to the script file +/// or when we have waited some time for a character (c == 0). +/// +/// All the changed memfiles are synced if c == 0 or when the number of typed +/// characters reaches 'updatecount' and 'updatecount' is non-zero. static void updatescript(int c) { static int count = 0; diff --git a/src/nvim/memline.c b/src/nvim/memline.c index dd80ec8d6a..1e26a728a3 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -1613,15 +1613,16 @@ void ml_sync_all(int check_file, int check_char, bool do_fsync) || file_info.stat.st_mtim.tv_sec != buf->b_mtime_read || os_fileinfo_size(&file_info) != buf->b_orig_size) { ml_preserve(buf, false, do_fsync); - did_check_timestamps = FALSE; - need_check_timestamps = TRUE; /* give message later */ + did_check_timestamps = false; + need_check_timestamps = true; // give message later } } if (buf->b_ml.ml_mfp->mf_dirty) { (void)mf_sync(buf->b_ml.ml_mfp, (check_char ? MFS_STOP : 0) | (do_fsync && bufIsChanged(buf) ? MFS_FLUSH : 0)); - if (check_char && os_char_avail()) /* character available now */ + if (check_char && os_char_avail()) { // character available now break; + } } } } @@ -1654,8 +1655,8 @@ void ml_preserve(buf_T *buf, int message, bool do_fsync) * before. */ got_int = FALSE; - ml_flush_line(buf); /* flush buffered line */ - (void)ml_find_line(buf, (linenr_T)0, ML_FLUSH); /* flush locked block */ + ml_flush_line(buf); // flush buffered line + (void)ml_find_line(buf, (linenr_T)0, ML_FLUSH); // flush locked block status = mf_sync(mfp, MFS_ALL | (do_fsync ? MFS_FLUSH : 0)); /* stack is invalid after mf_sync(.., MFS_ALL) */ @@ -1684,11 +1685,12 @@ void ml_preserve(buf_T *buf, int message, bool do_fsync) CHECK(buf->b_ml.ml_locked_low != lnum, "low != lnum"); lnum = buf->b_ml.ml_locked_high + 1; } - (void)ml_find_line(buf, (linenr_T)0, ML_FLUSH); /* flush locked block */ - /* sync the updated pointer blocks */ - if (mf_sync(mfp, MFS_ALL | (do_fsync ? MFS_FLUSH : 0)) == FAIL) + (void)ml_find_line(buf, (linenr_T)0, ML_FLUSH); // flush locked block + // sync the updated pointer blocks + if (mf_sync(mfp, MFS_ALL | (do_fsync ? MFS_FLUSH : 0)) == FAIL) { status = FAIL; - buf->b_ml.ml_stack_top = 0; /* stack is invalid now */ + } + buf->b_ml.ml_stack_top = 0; // stack is invalid now } theend: got_int |= got_int_save; |