From 243d16688a9275b3117abc746764f85df287aba9 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 27 Jul 2018 13:27:13 -0400 Subject: [PATCH 1/3] vim-patch:8.0.0837: signs can be drawn on top of console messages Problem: Signs can be drawn on top of console messages. Solution: don't redraw at a prompt or when scrolled up. (Christian Brabandt, closes vim/vim#1907) https://github.com/vim/vim/commit/0792048842493f224bbd7a5dfb348d834f61b205 --- src/nvim/screen.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 4774075086..8bed083c7b 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -569,9 +569,13 @@ void update_debug_sign(buf_T *buf, linenr_T lnum) } } - /* Return when there is nothing to do, screen updating is already - * happening (recursive call) or still starting up. */ - if (!doit || updating_screen || starting) { + // Return when there is nothing to do, screen updating is already + // happening (recursive call), messages on the screen or still starting up. + if (!doit + || updating_screen + || State == ASKMORE || State == HITRETURN + || msg_scrolled + || starting) { return; } From 882782f0fb019ee52c1be901b093644aa4134ab7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 27 Jul 2018 13:50:16 -0400 Subject: [PATCH 2/3] screen: add const and reindent update_debug_signs() --- src/nvim/screen.c | 79 ++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 8bed083c7b..9f0d8a5080 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -543,56 +543,57 @@ static void update_finish(void) updating_screen = FALSE; } -void update_debug_sign(buf_T *buf, linenr_T lnum) +void update_debug_sign(const buf_T *const buf, const linenr_T lnum) { - int doit = FALSE; - win_foldinfo.fi_level = 0; + bool doit = false; + win_foldinfo.fi_level = 0; - /* update/delete a specific mark */ - FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { - if (buf != NULL && lnum > 0) { - if (wp->w_buffer == buf && lnum >= wp->w_topline - && lnum < wp->w_botline) { - if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum) { - wp->w_redraw_top = lnum; - } - if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum) { - wp->w_redraw_bot = lnum; - } - redraw_win_later(wp, VALID); + // update/delete a specific mark + FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { + if (buf != NULL && lnum > 0) { + if (wp->w_buffer == buf && lnum >= wp->w_topline + && lnum < wp->w_botline) { + if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum) { + wp->w_redraw_top = lnum; + } + if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum) { + wp->w_redraw_bot = lnum; } - } else { redraw_win_later(wp, VALID); } - if (wp->w_redr_type != 0) { - doit = TRUE; - } + } else { + redraw_win_later(wp, VALID); } - - // Return when there is nothing to do, screen updating is already - // happening (recursive call), messages on the screen or still starting up. - if (!doit - || updating_screen - || State == ASKMORE || State == HITRETURN - || msg_scrolled - || starting) { - return; + if (wp->w_redr_type != 0) { + doit = true; } + } - /* update all windows that need updating */ - update_prepare(); + // Return when there is nothing to do, screen updating is already + // happening (recursive call), messages on the screen or still starting up. + if (!doit + || updating_screen + || State == ASKMORE + || State == HITRETURN + || msg_scrolled + || starting) { + return; + } - FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { - if (wp->w_redr_type != 0) { - update_window_hl(wp, wp->w_redr_type >= NOT_VALID); - win_update(wp); - } - if (wp->w_redr_status) { - win_redr_status(wp); - } + // update all windows that need updating + update_prepare(); + + FOR_ALL_WINDOWS_IN_TAB(wp, curtab) { + if (wp->w_redr_type != 0) { + update_window_hl(wp, wp->w_redr_type >= NOT_VALID); + win_update(wp); } + if (wp->w_redr_status) { + win_redr_status(wp); + } + } - update_finish(); + update_finish(); } /* From e09e9ca8103f55d3913816388c5754cc2afe3109 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 27 Jul 2018 14:44:18 -0400 Subject: [PATCH 3/3] lint --- src/nvim/file_search.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 6c1a2f6d7b..ee775bab4a 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -1221,18 +1221,19 @@ static ff_stack_T *ff_pop(ff_search_ctx_T *search_ctx) /* * free the given stack element */ -static void ff_free_stack_element(ff_stack_T *stack_ptr) +static void ff_free_stack_element(ff_stack_T *const stack_ptr) { if (stack_ptr == NULL) { return; } - /* free handles possible NULL pointers */ + // free handles possible NULL pointers xfree(stack_ptr->ffs_fix_path); xfree(stack_ptr->ffs_wc_path); - if (stack_ptr->ffs_filearray != NULL) + if (stack_ptr->ffs_filearray != NULL) { FreeWild(stack_ptr->ffs_filearray_size, stack_ptr->ffs_filearray); + } xfree(stack_ptr); }