Lines Matching refs:wp

68 static void win_update(win_T *wp);
70 static void redraw_custom_statusline(win_T *wp);
76 static void win_redr_status(win_T *wp, int ignore_pum);
87 win_T *wp; in update_screen() local
181 FOR_ALL_WINDOWS(wp) in update_screen()
183 if (wp->w_winrow < msg_scrolled) in update_screen()
185 if (W_WINROW(wp) + wp->w_height > msg_scrolled in update_screen()
186 && wp->w_redr_type < REDRAW_TOP in update_screen()
187 && wp->w_lines_valid > 0 in update_screen()
188 && wp->w_topline == wp->w_lines[0].wl_lnum) in update_screen()
190 wp->w_upd_rows = msg_scrolled - W_WINROW(wp); in update_screen()
191 wp->w_redr_type = REDRAW_TOP; in update_screen()
195 wp->w_redr_type = NOT_VALID; in update_screen()
196 if (W_WINROW(wp) + wp->w_height + wp->w_status_height in update_screen()
198 wp->w_redr_status = TRUE; in update_screen()
264 FOR_ALL_WINDOWS(wp) in update_screen()
266 if (wp->w_buffer->b_mod_set) in update_screen()
271 for (wwp = firstwin; wwp != wp; wwp = wwp->w_next) in update_screen()
272 if (wwp->w_buffer == wp->w_buffer) in update_screen()
274 if (wwp == wp && syntax_present(wp)) in update_screen()
275 syn_stack_apply_changes(wp->w_buffer); in update_screen()
293 FOR_ALL_WINDOWS(wp) in update_screen()
295 if (wp->w_redr_type != 0) in update_screen()
308 if (gui.in_use && (wp == curwin || cursor_is_sleeping())) in update_screen()
317 win_update(wp); in update_screen()
321 if (wp->w_redr_status) in update_screen()
324 win_redr_status(wp, TRUE); // any popup menu will be redrawn below in update_screen()
337 FOR_ALL_WINDOWS(wp) in update_screen()
338 wp->w_buffer->b_mod_set = FALSE; in update_screen()
393 statusline_row(win_T *wp) in statusline_row() argument
397 if (wp->w_frame->fr_height == wp->w_status_height && !popup_is_popup(wp)) in statusline_row()
398 return wp->w_winrow; in statusline_row()
400 return W_WINROW(wp) + wp->w_height; in statusline_row()
411 win_redr_status(win_T *wp, int ignore_pum UNUSED) in win_redr_status() argument
427 row = statusline_row(wp); in win_redr_status()
429 wp->w_redr_status = FALSE; in win_redr_status()
430 if (wp->w_status_height == 0) in win_redr_status()
441 wp->w_redr_status = TRUE; in win_redr_status()
444 else if (*p_stl != NUL || *wp->w_p_stl != NUL) in win_redr_status()
447 redraw_custom_statusline(wp); in win_redr_status()
452 fillchar = fillchar_status(&attr, wp); in win_redr_status()
454 get_trans_bufname(wp->w_buffer); in win_redr_status()
458 if (bt_help(wp->w_buffer) in win_redr_status()
460 || wp->w_p_pvw in win_redr_status()
462 || bufIsChanged(wp->w_buffer) in win_redr_status()
463 || wp->w_buffer->b_p_ro) in win_redr_status()
465 if (bt_help(wp->w_buffer)) in win_redr_status()
471 if (wp->w_p_pvw) in win_redr_status()
477 if (bufIsChanged(wp->w_buffer) in win_redr_status()
479 && !bt_terminal(wp->w_buffer) in win_redr_status()
486 if (wp->w_buffer->b_p_ro) in win_redr_status()
492 this_ru_col = ru_col - (Columns - wp->w_width); in win_redr_status()
493 if (this_ru_col < (wp->w_width + 1) / 2) in win_redr_status()
494 this_ru_col = (wp->w_width + 1) / 2; in win_redr_status()
528 screen_puts(p, row, wp->w_wincol, attr); in win_redr_status()
529 screen_fill(row, row + 1, len + wp->w_wincol, in win_redr_status()
530 this_ru_col + wp->w_wincol, fillchar, fillchar, attr); in win_redr_status()
532 if (get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL) in win_redr_status()
535 - 1 + wp->w_wincol), attr); in win_redr_status()
538 win_redr_ruler(wp, TRUE, ignore_pum); in win_redr_status()
545 if (wp->w_vsep_width != 0 && wp->w_status_height != 0 && redrawing()) in win_redr_status()
547 if (stl_connected(wp)) in win_redr_status()
548 fillchar = fillchar_status(&attr, wp); in win_redr_status()
551 screen_putchar(fillchar, row, W_ENDCOL(wp), attr); in win_redr_status()
562 redraw_custom_statusline(win_T *wp) in redraw_custom_statusline() argument
574 win_redr_custom(wp, FALSE); in redraw_custom_statusline()
581 (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL in redraw_custom_statusline()
629 win_redr_ruler(win_T *wp, int always, int ignore_pum) in win_redr_ruler() argument
653 if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count) in win_redr_ruler()
658 if (wp == lastwin && lastwin->w_status_height == 0) in win_redr_ruler()
671 win_redr_custom(wp, TRUE); in win_redr_ruler()
683 && *ml_get_buf(wp->w_buffer, wp->w_cursor.lnum, FALSE) == NUL) in win_redr_ruler()
689 validate_virtcol_win(wp); in win_redr_ruler()
692 || wp->w_cursor.lnum != wp->w_ru_cursor.lnum in win_redr_ruler()
693 || wp->w_cursor.col != wp->w_ru_cursor.col in win_redr_ruler()
694 || wp->w_virtcol != wp->w_ru_virtcol in win_redr_ruler()
695 || wp->w_cursor.coladd != wp->w_ru_cursor.coladd in win_redr_ruler()
696 || wp->w_topline != wp->w_ru_topline in win_redr_ruler()
697 || wp->w_buffer->b_ml.ml_line_count != wp->w_ru_line_count in win_redr_ruler()
699 || wp->w_topfill != wp->w_ru_topfill in win_redr_ruler()
701 || empty_line != wp->w_ru_empty) in win_redr_ruler()
704 if (wp->w_status_height) in win_redr_ruler()
706 row = statusline_row(wp); in win_redr_ruler()
707 fillchar = fillchar_status(&attr, wp); in win_redr_ruler()
708 off = wp->w_wincol; in win_redr_ruler()
709 width = wp->w_width; in win_redr_ruler()
721 virtcol = wp->w_virtcol; in win_redr_ruler()
722 if (wp->w_p_list && wp->w_lcs_chars.tab1 == NUL) in win_redr_ruler()
724 wp->w_p_list = FALSE; in win_redr_ruler()
725 getvvcol(wp, &wp->w_cursor, NULL, &virtcol, NULL); in win_redr_ruler()
726 wp->w_p_list = TRUE; in win_redr_ruler()
734 (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) in win_redr_ruler()
736 : (long)(wp->w_cursor.lnum)); in win_redr_ruler()
739 empty_line ? 0 : (int)wp->w_cursor.col + 1, in win_redr_ruler()
748 get_rel_pos(wp, buffer + i + 1, RULER_BUF_LEN - i - 1); in win_redr_ruler()
750 if (wp->w_status_height == 0) // can't use last char of screen in win_redr_ruler()
770 get_rel_pos(wp, buffer + i, RULER_BUF_LEN - i); in win_redr_ruler()
797 wp->w_ru_cursor = wp->w_cursor; in win_redr_ruler()
798 wp->w_ru_virtcol = wp->w_virtcol; in win_redr_ruler()
799 wp->w_ru_empty = empty_line; in win_redr_ruler()
800 wp->w_ru_topline = wp->w_topline; in win_redr_ruler()
801 wp->w_ru_line_count = wp->w_buffer->b_ml.ml_line_count; in win_redr_ruler()
803 wp->w_ru_topfill = wp->w_topfill; in win_redr_ruler()
848 text_to_screenline(win_T *wp, char_u *text, int col) in text_to_screenline() argument
866 if (wp->w_p_rl) in text_to_screenline()
877 if (col + cells > wp->w_width in text_to_screenline()
879 - (wp->w_p_rl ? col : 0) in text_to_screenline()
906 if (wp->w_p_rl) in text_to_screenline()
955 if (len > wp->w_width - col) in text_to_screenline()
956 len = wp->w_width - col; in text_to_screenline()
960 if (wp->w_p_rl) in text_to_screenline()
977 redraw_win_toolbar(win_T *wp) in redraw_win_toolbar() argument
988 vim_free(wp->w_winbar_items); in redraw_win_toolbar()
989 FOR_ALL_CHILD_MENUS(wp->w_winbar, menu) in redraw_win_toolbar()
991 wp->w_winbar_items = ALLOC_CLEAR_MULT(winbar_item_T, item_count + 1); in redraw_win_toolbar()
994 for (menu = wp->w_winbar->children; in redraw_win_toolbar()
995 menu != NULL && col < wp->w_width; menu = menu->next) in redraw_win_toolbar()
998 if (++col >= wp->w_width) in redraw_win_toolbar()
1003 if (++col >= wp->w_width) in redraw_win_toolbar()
1007 wp->w_winbar_items[item_idx].wb_startcol = col; in redraw_win_toolbar()
1009 if (++col >= wp->w_width) in redraw_win_toolbar()
1012 next_col = text_to_screenline(wp, menu->name, col); in redraw_win_toolbar()
1018 wp->w_winbar_items[item_idx].wb_endcol = col; in redraw_win_toolbar()
1019 wp->w_winbar_items[item_idx].wb_menu = menu; in redraw_win_toolbar()
1022 if (col >= wp->w_width) in redraw_win_toolbar()
1027 while (col < wp->w_width) in redraw_win_toolbar()
1032 wp->w_winbar_items[item_idx].wb_menu = NULL; // end marker in redraw_win_toolbar()
1034 screen_line(wp->w_winrow, wp->w_wincol, (int)wp->w_width, in redraw_win_toolbar()
1035 (int)wp->w_width, 0); in redraw_win_toolbar()
1064 win_T *wp, in fold_line() argument
1095 if (cmdwin_type != 0 && wp == curwin) in fold_line()
1108 if (wp->w_p_rl) \ in fold_line()
1110 ScreenAttrs[off + (wp->w_width - (p) - (l)) + ri] = v; \ in fold_line()
1125 fdc = compute_foldcolumn(wp, col); in fold_line()
1132 fill_foldcolumn(buf, wp, TRUE, lnum); in fold_line()
1143 if (wp->w_p_rl) in fold_line()
1144 idx = off + wp->w_width - i - 1 - col; in fold_line()
1172 RL_MEMSET(col, HL_ATTR(HLF_FL), wp->w_width - col); in fold_line()
1176 if (signcolumn_on(wp)) in fold_line()
1178 len = wp->w_width - col; in fold_line()
1184 if (wp->w_p_rl) in fold_line()
1186 copy_text_attr(off + wp->w_width - len - col, in fold_line()
1197 if (wp->w_p_nu || wp->w_p_rnu) in fold_line()
1199 len = wp->w_width - col; in fold_line()
1202 int w = number_width(wp); in fold_line()
1209 if (wp->w_p_nu && !wp->w_p_rnu) in fold_line()
1215 num = labs((long)get_cursor_rel_lnum(wp, lnum)); in fold_line()
1216 if (num == 0 && wp->w_p_nu && wp->w_p_rnu) in fold_line()
1227 if (wp->w_p_rl) in fold_line()
1229 copy_text_attr(off + wp->w_width - len - col, buf, len, in fold_line()
1239 text = get_foldtext(wp, lnum, lnume, foldinfo, buf); in fold_line()
1246 col = text_to_screenline(wp, text, col); in fold_line()
1250 if (wp->w_p_rl) in fold_line()
1253 while (col < wp->w_width in fold_line()
1255 - (wp->w_p_rl ? txtcol : 0) in fold_line()
1283 if (VIsual_active && wp->w_buffer == curwin->w_buffer) in fold_line()
1306 >= (colnr_T)STRLEN(ml_get_buf(wp->w_buffer, lnume, FALSE))))))) in fold_line()
1311 if (wp->w_old_cursor_fcol + txtcol < (colnr_T)wp->w_width) in fold_line()
1313 if (wp->w_old_cursor_lcol != MAXCOL in fold_line()
1314 && wp->w_old_cursor_lcol + txtcol in fold_line()
1315 < (colnr_T)wp->w_width) in fold_line()
1316 len = wp->w_old_cursor_lcol; in fold_line()
1318 len = wp->w_width - txtcol; in fold_line()
1319 RL_MEMSET(wp->w_old_cursor_fcol + txtcol, HL_ATTR(HLF_V), in fold_line()
1320 len - (int)wp->w_old_cursor_fcol); in fold_line()
1326 RL_MEMSET(txtcol, HL_ATTR(HLF_V), wp->w_width - txtcol); in fold_line()
1333 if (wp->w_p_cc_cols) in fold_line()
1336 int j = wp->w_p_cc_cols[i]; in fold_line()
1342 if (wp->w_p_wrap) in fold_line()
1343 txtcol -= wp->w_skipcol; in fold_line()
1345 txtcol -= wp->w_leftcol; in fold_line()
1346 if (txtcol >= 0 && txtcol < wp->w_width) in fold_line()
1350 j = wp->w_p_cc_cols[++i]; in fold_line()
1355 if (wp->w_p_cuc) in fold_line()
1357 txtcol += wp->w_virtcol; in fold_line()
1358 if (wp->w_p_wrap) in fold_line()
1359 txtcol -= wp->w_skipcol; in fold_line()
1361 txtcol -= wp->w_leftcol; in fold_line()
1362 if (txtcol >= 0 && txtcol < wp->w_width) in fold_line()
1368 screen_line(row + W_WINROW(wp), wp->w_wincol, (int)wp->w_width, in fold_line()
1369 (int)wp->w_width, 0); in fold_line()
1373 if (wp == curwin in fold_line()
1385 if (wp == curwin in fold_line()
1386 && wp->w_cursor.lnum >= lnum in fold_line()
1387 && wp->w_cursor.lnum <= lnume in fold_line()
1388 && conceal_cursor_line(wp)) in fold_line()
1422 win_update(win_T *wp) in win_update() argument
1424 buf_T *buf = wp->w_buffer; in win_update()
1450 linenr_T old_botline = wp->w_botline; in win_update()
1452 int old_wrow = wp->w_wrow; in win_update()
1453 int old_wcol = wp->w_wcol; in win_update()
1495 type = wp->w_redr_type; in win_update()
1499 wp->w_redr_status = TRUE; in win_update()
1500 wp->w_lines_valid = 0; in win_update()
1504 if (wp->w_height + WINBAR_HEIGHT(wp) == 0 in win_update()
1505 || (wp->w_frame->fr_height == wp->w_status_height in win_update()
1507 && !popup_is_popup(wp) in win_update()
1511 wp->w_redr_type = 0; in win_update()
1516 if (wp->w_width == 0) in win_update()
1519 draw_vsep_win(wp, 0); in win_update()
1520 wp->w_redr_type = 0; in win_update()
1526 if (term_do_update_window(wp)) in win_update()
1528 term_update_window(wp); in win_update()
1531 if (winbar_height(wp) > 0) in win_update()
1532 redraw_win_toolbar(wp); in win_update()
1534 wp->w_redr_type = 0; in win_update()
1540 init_search_hl(wp, &screen_search_hl); in win_update()
1546 i = (wp->w_p_nu || wp->w_p_rnu) ? number_width(wp) : 0; in win_update()
1547 if (wp->w_nrwidth != i) in win_update()
1550 wp->w_nrwidth = i; in win_update()
1555 if (buf->b_mod_set && buf->b_mod_xlines != 0 && wp->w_redraw_top != 0) in win_update()
1566 mod_top = wp->w_redraw_top; in win_update()
1567 if (wp->w_redraw_bot != 0) in win_update()
1568 mod_bot = wp->w_redraw_bot + 1; in win_update()
1579 if (syntax_present(wp)) in win_update()
1601 matchitem_T *cur = wp->w_match_head; in win_update()
1617 if (mod_top != 0 && hasAnyFolding(wp)) in win_update()
1631 lnumt = wp->w_topline; in win_update()
1633 for (i = 0; i < wp->w_lines_valid; ++i) in win_update()
1634 if (wp->w_lines[i].wl_valid) in win_update()
1636 if (wp->w_lines[i].wl_lastlnum < mod_top) in win_update()
1637 lnumt = wp->w_lines[i].wl_lastlnum + 1; in win_update()
1638 if (lnumb == MAXLNUM && wp->w_lines[i].wl_lnum >= mod_bot) in win_update()
1640 lnumb = wp->w_lines[i].wl_lnum; in win_update()
1643 if (compute_foldcolumn(wp, 0) > 0) in win_update()
1648 (void)hasFoldingWin(wp, mod_top, &mod_top, NULL, TRUE, NULL); in win_update()
1654 (void)hasFoldingWin(wp, mod_bot, NULL, &mod_bot, TRUE, NULL); in win_update()
1665 if (mod_top != 0 && mod_top < wp->w_topline) in win_update()
1667 if (mod_bot > wp->w_topline) in win_update()
1668 mod_top = wp->w_topline; in win_update()
1670 else if (syntax_present(wp)) in win_update()
1677 if (mod_top != 0 && buf->b_mod_xlines != 0 && wp->w_p_nu) in win_update()
1680 wp->w_redraw_top = 0; // reset for next time in win_update()
1681 wp->w_redraw_bot = 0; in win_update()
1688 for (i = 0; i < wp->w_lines_valid; ++i) in win_update()
1690 j += wp->w_lines[i].wl_size; in win_update()
1691 if (j >= wp->w_upd_rows) in win_update()
1721 && !wp->w_botfill && !wp->w_old_botfill in win_update()
1726 && wp->w_topline == mod_top in win_update()
1727 && (!wp->w_lines[0].wl_valid in win_update()
1728 || wp->w_topline <= wp->w_lines[0].wl_lnum)) in win_update()
1733 else if (wp->w_lines[0].wl_valid in win_update()
1734 && (wp->w_topline < wp->w_lines[0].wl_lnum in win_update()
1736 || (wp->w_topline == wp->w_lines[0].wl_lnum in win_update()
1737 && wp->w_topfill > wp->w_old_topfill) in win_update()
1743 if (hasAnyFolding(wp)) in win_update()
1750 for (ln = wp->w_topline; ln < wp->w_lines[0].wl_lnum; ++ln) in win_update()
1753 if (j >= wp->w_height - 2) in win_update()
1755 (void)hasFoldingWin(wp, ln, NULL, &ln, TRUE, NULL); in win_update()
1760 j = wp->w_lines[0].wl_lnum - wp->w_topline; in win_update()
1761 if (j < wp->w_height - 2) // not too far off in win_update()
1763 i = plines_m_win(wp, wp->w_topline, wp->w_lines[0].wl_lnum - 1); in win_update()
1766 if (wp->w_lines[0].wl_lnum != wp->w_topline) in win_update()
1767 i += diff_check_fill(wp, wp->w_lines[0].wl_lnum) in win_update()
1768 - wp->w_old_topfill; in win_update()
1770 if (i < wp->w_height - 2) // less than a screen off in win_update()
1777 if (win_ins_lines(wp, 0, i, FALSE, wp == firstwin) == OK) in win_update()
1779 if (wp->w_lines_valid != 0) in win_update()
1788 if ((wp->w_lines_valid += j) > wp->w_height) in win_update()
1789 wp->w_lines_valid = wp->w_height; in win_update()
1790 for (idx = wp->w_lines_valid; idx - j >= 0; idx--) in win_update()
1791 wp->w_lines[idx] = wp->w_lines[idx - j]; in win_update()
1793 wp->w_lines[idx--].wl_valid = FALSE; in win_update()
1814 for (i = 0; i < wp->w_lines_valid; i++) in win_update()
1816 if (wp->w_lines[i].wl_valid in win_update()
1817 && wp->w_lines[i].wl_lnum == wp->w_topline) in win_update()
1822 row += wp->w_lines[i].wl_size; in win_update()
1837 if (wp->w_lines[0].wl_lnum == wp->w_topline) in win_update()
1838 row += wp->w_old_topfill; in win_update()
1840 row += diff_check_fill(wp, wp->w_topline); in win_update()
1842 row -= wp->w_topfill; in win_update()
1847 if (win_del_lines(wp, 0, row, FALSE, wp == firstwin, 0) in win_update()
1849 bot_start = wp->w_height - row; in win_update()
1853 if ((row == 0 || bot_start < 999) && wp->w_lines_valid != 0) in win_update()
1863 wp->w_lines[idx] = wp->w_lines[j]; in win_update()
1867 + (int)wp->w_lines[j].wl_size > wp->w_height) in win_update()
1869 wp->w_lines_valid = idx + 1; in win_update()
1872 bot_start += wp->w_lines[idx++].wl_size; in win_update()
1875 if (++j >= wp->w_lines_valid) in win_update()
1877 wp->w_lines_valid = idx; in win_update()
1884 if (wp->w_p_diff && bot_start > 0) in win_update()
1885 wp->w_lines[0].wl_size = in win_update()
1886 plines_win_nofill(wp, wp->w_topline, TRUE) in win_update()
1887 + wp->w_topfill; in win_update()
1898 mid_end = wp->w_height; in win_update()
1899 if (ONE_WINDOW && !WIN_IS_POPUP(wp)) in win_update()
1923 mid_end = wp->w_height; in win_update()
1930 mid_end = wp->w_height; in win_update()
1936 || (wp->w_old_cursor_lnum != 0 && type != NOT_VALID)) in win_update()
1943 && (VIsual_mode != wp->w_old_visual_mode in win_update()
1960 if (wp->w_old_cursor_lnum < from) in win_update()
1961 from = wp->w_old_cursor_lnum; in win_update()
1962 if (wp->w_old_cursor_lnum > to) in win_update()
1963 to = wp->w_old_cursor_lnum; in win_update()
1964 if (wp->w_old_visual_lnum < from) in win_update()
1965 from = wp->w_old_visual_lnum; in win_update()
1966 if (wp->w_old_visual_lnum > to) in win_update()
1967 to = wp->w_old_visual_lnum; in win_update()
1974 if (curwin->w_cursor.lnum < wp->w_old_cursor_lnum) in win_update()
1977 to = wp->w_old_cursor_lnum; in win_update()
1981 from = wp->w_old_cursor_lnum; in win_update()
1987 if (VIsual.lnum != wp->w_old_visual_lnum in win_update()
1988 || VIsual.col != wp->w_old_visual_col) in win_update()
1990 if (wp->w_old_visual_lnum < from in win_update()
1991 && wp->w_old_visual_lnum != 0) in win_update()
1992 from = wp->w_old_visual_lnum; in win_update()
1993 if (wp->w_old_visual_lnum > to) in win_update()
1994 to = wp->w_old_visual_lnum; in win_update()
2014 getvcols(wp, &VIsual, &curwin->w_cursor, &fromc, &toc); in win_update()
2039 pos.col = (int)STRLEN(ml_get_buf(wp->w_buffer, in win_update()
2041 getvvcol(wp, &pos, NULL, NULL, &t); in win_update()
2051 if (fromc != wp->w_old_cursor_fcol in win_update()
2052 || toc != wp->w_old_cursor_lcol) in win_update()
2059 wp->w_old_cursor_fcol = fromc; in win_update()
2060 wp->w_old_cursor_lcol = toc; in win_update()
2066 if (wp->w_old_cursor_lnum < wp->w_old_visual_lnum) in win_update()
2068 from = wp->w_old_cursor_lnum; in win_update()
2069 to = wp->w_old_visual_lnum; in win_update()
2073 from = wp->w_old_visual_lnum; in win_update()
2074 to = wp->w_old_cursor_lnum; in win_update()
2079 if (from < wp->w_topline) in win_update()
2080 from = wp->w_topline; in win_update()
2084 if (wp->w_valid & VALID_BOTLINE) in win_update()
2086 if (from >= wp->w_botline) in win_update()
2087 from = wp->w_botline - 1; in win_update()
2088 if (to >= wp->w_botline) in win_update()
2089 to = wp->w_botline - 1; in win_update()
2101 lnum = wp->w_topline; in win_update()
2108 while (lnum < from && idx < wp->w_lines_valid) // find start in win_update()
2110 if (wp->w_lines[idx].wl_valid) in win_update()
2111 mid_start += wp->w_lines[idx].wl_size; in win_update()
2113 srow += wp->w_lines[idx].wl_size; in win_update()
2116 if (idx < wp->w_lines_valid && wp->w_lines[idx].wl_valid) in win_update()
2117 lnum = wp->w_lines[idx].wl_lnum; in win_update()
2123 mid_end = wp->w_height; in win_update()
2124 for ( ; idx < wp->w_lines_valid; ++idx) // find end in win_update()
2126 if (wp->w_lines[idx].wl_valid in win_update()
2127 && wp->w_lines[idx].wl_lnum >= to + 1) in win_update()
2133 srow += wp->w_lines[idx].wl_size; in win_update()
2140 wp->w_old_visual_mode = VIsual_mode; in win_update()
2141 wp->w_old_cursor_lnum = curwin->w_cursor.lnum; in win_update()
2142 wp->w_old_visual_lnum = VIsual.lnum; in win_update()
2143 wp->w_old_visual_col = VIsual.col; in win_update()
2144 wp->w_old_curswant = curwin->w_curswant; in win_update()
2148 wp->w_old_visual_mode = 0; in win_update()
2149 wp->w_old_cursor_lnum = 0; in win_update()
2150 wp->w_old_visual_lnum = 0; in win_update()
2151 wp->w_old_visual_col = 0; in win_update()
2171 if (winbar_height(wp) > 0) in win_update()
2172 redraw_win_toolbar(wp); in win_update()
2179 lnum = wp->w_topline; // first line shown in window in win_update()
2184 if (row == wp->w_height) in win_update()
2213 || idx >= wp->w_lines_valid in win_update()
2214 || (row + wp->w_lines[idx].wl_size > bot_start) in win_update()
2222 && syntax_present(wp) in win_update()
2225 (foldmethodIsSyntax(wp) in win_update()
2226 && hasAnyFolding(wp)) || in win_update()
2233 || (wp->w_match_head != NULL in win_update()
2238 || (wp->w_p_cul && (lnum == wp->w_cursor.lnum in win_update()
2239 || lnum == wp->w_last_cursorline)) in win_update()
2266 for (i = idx; i < wp->w_lines_valid; ++i) in win_update()
2270 if (wp->w_lines[i].wl_valid in win_update()
2271 && wp->w_lines[i].wl_lnum == mod_bot) in win_update()
2273 old_rows += wp->w_lines[i].wl_size; in win_update()
2275 if (wp->w_lines[i].wl_valid in win_update()
2276 && wp->w_lines[i].wl_lastlnum + 1 == mod_bot) in win_update()
2281 while (i < wp->w_lines_valid in win_update()
2282 && !wp->w_lines[i].wl_valid) in win_update()
2283 old_rows += wp->w_lines[i++].wl_size; in win_update()
2289 if (i >= wp->w_lines_valid) in win_update()
2304 if (hasFoldingWin(wp, l, NULL, &l, TRUE, NULL)) in win_update()
2310 if (l == wp->w_topline) in win_update()
2311 new_rows += plines_win_nofill(wp, l, TRUE) in win_update()
2312 + wp->w_topfill; in win_update()
2315 new_rows += plines_win(wp, l, TRUE); in win_update()
2318 if (new_rows > wp->w_height - row - 2) in win_update()
2332 if (row - xtra_rows >= wp->w_height - 2) in win_update()
2337 if (win_del_lines(wp, row, in win_update()
2341 bot_start = wp->w_height + xtra_rows; in win_update()
2349 if (row + xtra_rows >= wp->w_height - 2) in win_update()
2354 if (win_ins_lines(wp, row + old_rows, in win_update()
2376 if (i >= wp->w_lines_valid) in win_update()
2378 wp->w_lines_valid = j; in win_update()
2381 wp->w_lines[j] = wp->w_lines[i]; in win_update()
2383 if (x + (int)wp->w_lines[j].wl_size in win_update()
2384 > wp->w_height) in win_update()
2386 wp->w_lines_valid = j + 1; in win_update()
2389 x += wp->w_lines[j++].wl_size; in win_update()
2399 wp->w_lines_valid += j; in win_update()
2400 if (wp->w_lines_valid > wp->w_height) in win_update()
2401 wp->w_lines_valid = wp->w_height; in win_update()
2402 for (i = wp->w_lines_valid; i - j >= idx; --i) in win_update()
2403 wp->w_lines[i] = wp->w_lines[i - j]; in win_update()
2410 wp->w_lines[i].wl_size = 0; in win_update()
2411 wp->w_lines[i--].wl_valid = FALSE; in win_update()
2422 fold_count = foldedCount(wp, lnum, &win_foldinfo); in win_update()
2425 fold_line(wp, fold_count, &win_foldinfo, lnum, row); in win_update()
2428 wp->w_lines[idx].wl_folded = TRUE; in win_update()
2429 wp->w_lines[idx].wl_lastlnum = lnum + fold_count; in win_update()
2436 if (idx < wp->w_lines_valid in win_update()
2437 && wp->w_lines[idx].wl_valid in win_update()
2438 && wp->w_lines[idx].wl_lnum == lnum in win_update()
2439 && lnum > wp->w_topline in win_update()
2441 && !WIN_IS_POPUP(wp) in win_update()
2442 && srow + wp->w_lines[idx].wl_size > wp->w_height in win_update()
2444 && diff_check_fill(wp, lnum) == 0 in win_update()
2450 row = wp->w_height + 1; in win_update()
2455 prepare_search_hl(wp, &screen_search_hl, lnum); in win_update()
2460 && syntax_present(wp)) in win_update()
2465 row = win_line(wp, lnum, srow, wp->w_height, in win_update()
2469 wp->w_lines[idx].wl_folded = FALSE; in win_update()
2470 wp->w_lines[idx].wl_lastlnum = lnum; in win_update()
2478 wp->w_lines[idx].wl_lnum = lnum; in win_update()
2479 wp->w_lines[idx].wl_valid = TRUE; in win_update()
2484 if (row > wp->w_height || row + wp->w_winrow >= Rows) in win_update()
2488 wp->w_lines[idx].wl_size = plines_win(wp, lnum, TRUE); in win_update()
2493 wp->w_lines[idx].wl_size = row - srow; in win_update()
2503 if (wp->w_p_rnu) in win_update()
2508 fold_count = foldedCount(wp, lnum, &win_foldinfo); in win_update()
2510 fold_line(wp, fold_count, &win_foldinfo, lnum, row); in win_update()
2513 (void)win_line(wp, lnum, srow, wp->w_height, TRUE, TRUE); in win_update()
2517 row += wp->w_lines[idx++].wl_size; in win_update()
2518 if (row > wp->w_height) // past end of screen in win_update()
2521 lnum = wp->w_lines[idx - 1].wl_lastlnum + 1; in win_update()
2558 if (idx > wp->w_lines_valid) in win_update()
2559 wp->w_lines_valid = idx; in win_update()
2563 if (syntax_last_parsed != 0 && syntax_present(wp)) in win_update()
2569 wp->w_empty_rows = 0; in win_update()
2571 wp->w_filler_rows = 0; in win_update()
2575 if (lnum == wp->w_topline) in win_update()
2579 wp->w_botline = lnum + 1; in win_update()
2582 else if (diff_check_fill(wp, lnum) >= wp->w_height - srow) in win_update()
2585 wp->w_botline = lnum; in win_update()
2586 wp->w_filler_rows = wp->w_height - srow; in win_update()
2590 else if (WIN_IS_POPUP(wp)) in win_update()
2593 wp->w_botline = lnum; in win_update()
2598 int scr_row = W_WINROW(wp) + wp->w_height - 1; in win_update()
2601 screen_puts_len((char_u *)"@@", 2, scr_row, wp->w_wincol, in win_update()
2604 (int)wp->w_wincol + 2, (int)W_ENDCOL(wp), in win_update()
2606 set_empty_rows(wp, srow); in win_update()
2607 wp->w_botline = lnum; in win_update()
2612 screen_fill(W_WINROW(wp) + wp->w_height - 1, in win_update()
2613 W_WINROW(wp) + wp->w_height, in win_update()
2614 (int)W_ENDCOL(wp) - 3, (int)W_ENDCOL(wp), in win_update()
2616 set_empty_rows(wp, srow); in win_update()
2617 wp->w_botline = lnum; in win_update()
2621 win_draw_end(wp, '@', ' ', TRUE, srow, wp->w_height, HLF_AT); in win_update()
2622 wp->w_botline = lnum; in win_update()
2627 draw_vsep_win(wp, row); in win_update()
2630 wp->w_botline = buf->b_ml.ml_line_count + 1; in win_update()
2632 j = diff_check_fill(wp, wp->w_botline); in win_update()
2633 if (j > 0 && !wp->w_botfill) in win_update()
2640 if (row + j > wp->w_height) in win_update()
2641 j = wp->w_height - row; in win_update()
2642 win_draw_end(wp, i, i, TRUE, row, row + (int)j, HLF_DED); in win_update()
2648 wp->w_botline = lnum; in win_update()
2652 if (WIN_IS_POPUP(wp)) in win_update()
2653 win_draw_end(wp, ' ', ' ', FALSE, row, wp->w_height, HLF_AT); in win_update()
2655 win_draw_end(wp, fill_eob, ' ', FALSE, row, wp->w_height, HLF_EOB); in win_update()
2663 wp->w_redr_type = 0; in win_update()
2665 wp->w_old_topfill = wp->w_topfill; in win_update()
2666 wp->w_old_botfill = wp->w_botfill; in win_update()
2681 wp->w_valid |= VALID_BOTLINE; in win_update()
2682 if (wp == curwin && wp->w_botline != old_botline && !recursive) in win_update()
2686 linenr_T old_topline = wp->w_topline; in win_update()
2687 int new_wcol = wp->w_wcol; in win_update()
2694 if (old_wcol != new_wcol && (wp->w_valid & (VALID_WCOL|VALID_WROW)) in win_update()
2706 if (wp->w_wcol == old_wcol && wp->w_wrow == old_wrow in win_update()
2707 && old_topline == wp->w_topline) in win_update()
2708 wp->w_wcol = new_wcol; in win_update()
2710 redrawWinline(wp, wp->w_cursor.lnum); in win_update()
2714 if (wp->w_redr_type != 0) in win_update()
2797 win_T *wp; in update_debug_sign() local
2808 FOR_ALL_WINDOWS(wp) in update_debug_sign()
2809 if (wp->w_redr_type != 0) in update_debug_sign()
2826 FOR_ALL_WINDOWS(wp) in update_debug_sign()
2828 if (wp->w_redr_type != 0) in update_debug_sign()
2829 win_update(wp); in update_debug_sign()
2830 if (wp->w_redr_status) in update_debug_sign()
2831 win_redr_status(wp, FALSE); in update_debug_sign()
2844 updateWindow(win_T *wp) in updateWindow() argument
2860 win_update(wp); in updateWindow()
2866 if (wp->w_redr_status in updateWindow()
2871 || *p_stl != NUL || *wp->w_p_stl != NUL in updateWindow()
2874 win_redr_status(wp, FALSE); in updateWindow()
3089 win_T *wp, in redraw_win_later() argument
3092 if (!exiting && wp->w_redr_type < type) in redraw_win_later()
3094 wp->w_redr_type = type; in redraw_win_later()
3096 wp->w_lines_valid = 0; in redraw_win_later()
3119 win_T *wp; in redraw_all_later() local
3121 FOR_ALL_WINDOWS(wp) in redraw_all_later()
3122 redraw_win_later(wp, type); in redraw_all_later()
3140 win_T *wp; in redraw_buf_later() local
3142 FOR_ALL_WINDOWS(wp) in redraw_buf_later()
3144 if (wp->w_buffer == buf) in redraw_buf_later()
3145 redraw_win_later(wp, type); in redraw_buf_later()
3158 win_T *wp; in redraw_buf_line_later() local
3160 FOR_ALL_WINDOWS(wp) in redraw_buf_line_later()
3161 if (wp->w_buffer == buf && lnum >= wp->w_topline in redraw_buf_line_later()
3162 && lnum < wp->w_botline) in redraw_buf_line_later()
3163 redrawWinline(wp, lnum); in redraw_buf_line_later()
3171 win_T *wp; in redraw_buf_and_status_later() local
3179 FOR_ALL_WINDOWS(wp) in redraw_buf_and_status_later()
3181 if (wp->w_buffer == buf) in redraw_buf_and_status_later()
3183 redraw_win_later(wp, type); in redraw_buf_and_status_later()
3184 wp->w_redr_status = TRUE; in redraw_buf_and_status_later()
3196 win_T *wp; in status_redraw_all() local
3198 FOR_ALL_WINDOWS(wp) in status_redraw_all()
3199 if (wp->w_status_height) in status_redraw_all()
3201 wp->w_redr_status = TRUE; in status_redraw_all()
3212 win_T *wp; in status_redraw_curbuf() local
3214 FOR_ALL_WINDOWS(wp) in status_redraw_curbuf()
3215 if (wp->w_status_height != 0 && wp->w_buffer == curbuf) in status_redraw_curbuf()
3217 wp->w_redr_status = TRUE; in status_redraw_curbuf()
3228 win_T *wp; in redraw_statuslines() local
3230 FOR_ALL_WINDOWS(wp) in redraw_statuslines()
3231 if (wp->w_redr_status) in redraw_statuslines()
3232 win_redr_status(wp, FALSE); in redraw_statuslines()
3271 win_T *wp, in redrawWinline() argument
3274 if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum) in redrawWinline()
3275 wp->w_redraw_top = lnum; in redrawWinline()
3276 if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum) in redrawWinline()
3277 wp->w_redraw_bot = lnum; in redrawWinline()
3278 redraw_win_later(wp, VALID); in redrawWinline()