diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-27 13:50:16 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-27 18:43:53 -0400 |
commit | 882782f0fb019ee52c1be901b093644aa4134ab7 (patch) | |
tree | d80b1b9aabf3766b053f2f3ddcb07587625f2774 /src/nvim | |
parent | 243d16688a9275b3117abc746764f85df287aba9 (diff) | |
download | rneovim-882782f0fb019ee52c1be901b093644aa4134ab7.tar.gz rneovim-882782f0fb019ee52c1be901b093644aa4134ab7.tar.bz2 rneovim-882782f0fb019ee52c1be901b093644aa4134ab7.zip |
screen: add const and reindent update_debug_signs()
Diffstat (limited to 'src/nvim')
-rw-r--r-- | src/nvim/screen.c | 81 |
1 files changed, 41 insertions, 40 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; - - /* 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); + 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; } - } 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(); } /* |