mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 05:48:17 +00:00
Convert FOR_ALL_WINDOWS to use a locally declared pointer
This commit is contained in:
@@ -1206,7 +1206,6 @@ check_changed_any (
|
|||||||
int bufcount = 0;
|
int bufcount = 0;
|
||||||
int *bufnrs;
|
int *bufnrs;
|
||||||
tabpage_T *tp;
|
tabpage_T *tp;
|
||||||
win_T *wp;
|
|
||||||
|
|
||||||
FOR_ALL_BUFFERS(buf) {
|
FOR_ALL_BUFFERS(buf) {
|
||||||
++bufcount;
|
++bufcount;
|
||||||
@@ -1220,15 +1219,21 @@ check_changed_any (
|
|||||||
/* curbuf */
|
/* curbuf */
|
||||||
bufnrs[bufnum++] = curbuf->b_fnum;
|
bufnrs[bufnum++] = curbuf->b_fnum;
|
||||||
/* buf in curtab */
|
/* buf in curtab */
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
if (wp->w_buffer != curbuf)
|
if (wp->w_buffer != curbuf) {
|
||||||
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
|
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* buf in other tab */
|
/* buf in other tab */
|
||||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next) {
|
||||||
if (tp != curtab)
|
if (tp != curtab) {
|
||||||
for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
|
for (wint_T *wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next) {
|
||||||
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
|
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* any other buf */
|
/* any other buf */
|
||||||
FOR_ALL_BUFFERS(buf) {
|
FOR_ALL_BUFFERS(buf) {
|
||||||
add_bufnum(bufnrs, &bufnum, buf->b_fnum);
|
add_bufnum(bufnrs, &bufnum, buf->b_fnum);
|
||||||
@@ -1278,14 +1283,16 @@ check_changed_any (
|
|||||||
|
|
||||||
/* Try to find a window that contains the buffer. */
|
/* Try to find a window that contains the buffer. */
|
||||||
if (buf != curbuf)
|
if (buf != curbuf)
|
||||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
wint_T *wp;
|
||||||
if (wp->w_buffer == buf) {
|
FOR_ALL_TAB_WINDOWS(tp, wp) {
|
||||||
goto_tabpage_win(tp, wp);
|
if (wp->w_buffer == buf) {
|
||||||
/* Paranoia: did autocms wipe out the buffer with changes? */
|
goto_tabpage_win(tp, wp);
|
||||||
if (!buf_valid(buf)) {
|
/* Paranoia: did autocms wipe out the buffer with changes? */
|
||||||
goto theend;
|
if (!buf_valid(buf)) {
|
||||||
|
goto theend;
|
||||||
|
}
|
||||||
|
goto buf_found;
|
||||||
}
|
}
|
||||||
goto buf_found;
|
|
||||||
}
|
}
|
||||||
buf_found:
|
buf_found:
|
||||||
|
|
||||||
|
@@ -460,13 +460,10 @@ void newFoldLevel(void)
|
|||||||
newFoldLevelWin(curwin);
|
newFoldLevelWin(curwin);
|
||||||
|
|
||||||
if (foldmethodIsDiff(curwin) && curwin->w_p_scb) {
|
if (foldmethodIsDiff(curwin) && curwin->w_p_scb) {
|
||||||
win_T *wp;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the same foldlevel in other windows in diff mode.
|
* Set the same foldlevel in other windows in diff mode.
|
||||||
*/
|
*/
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
|
||||||
if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb) {
|
if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb) {
|
||||||
wp->w_p_fdl = curwin->w_p_fdl;
|
wp->w_p_fdl = curwin->w_p_fdl;
|
||||||
newFoldLevelWin(wp);
|
newFoldLevelWin(wp);
|
||||||
@@ -1140,19 +1137,18 @@ setManualFold (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (foldmethodIsDiff(curwin) && curwin->w_p_scb) {
|
if (foldmethodIsDiff(curwin) && curwin->w_p_scb) {
|
||||||
win_T *wp;
|
|
||||||
linenr_T dlnum;
|
linenr_T dlnum;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Do the same operation in other windows in diff mode. Calculate the
|
* Do the same operation in other windows in diff mode. Calculate the
|
||||||
* line number from the diffs.
|
* line number from the diffs.
|
||||||
*/
|
*/
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
|
||||||
if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb) {
|
if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb) {
|
||||||
dlnum = diff_lnum_win(curwin->w_cursor.lnum, wp);
|
dlnum = diff_lnum_win(curwin->w_cursor.lnum, wp);
|
||||||
if (dlnum != 0)
|
if (dlnum != 0) {
|
||||||
(void)setManualFoldWin(wp, dlnum, opening, recurse, NULL);
|
(void)setManualFoldWin(wp, dlnum, opening, recurse, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -519,7 +519,7 @@ EXTERN win_T *firstwin; /* first window */
|
|||||||
EXTERN win_T *lastwin; /* last window */
|
EXTERN win_T *lastwin; /* last window */
|
||||||
EXTERN win_T *prevwin INIT(= NULL); /* previous window */
|
EXTERN win_T *prevwin INIT(= NULL); /* previous window */
|
||||||
# define W_NEXT(wp) ((wp)->w_next)
|
# define W_NEXT(wp) ((wp)->w_next)
|
||||||
# define FOR_ALL_WINDOWS(wp) for (wp = firstwin; wp != NULL; wp = wp->w_next)
|
# define FOR_ALL_WINDOWS(wp) for (win_T *wp = firstwin; wp != NULL; wp = wp->w_next)
|
||||||
/*
|
/*
|
||||||
* When using this macro "break" only breaks out of the inner loop. Use "goto"
|
* When using this macro "break" only breaks out of the inner loop. Use "goto"
|
||||||
* to break out of the tabpage loop.
|
* to break out of the tabpage loop.
|
||||||
|
@@ -500,7 +500,6 @@ void fmarks_check_names(buf_T *buf)
|
|||||||
{
|
{
|
||||||
char_u *name;
|
char_u *name;
|
||||||
int i;
|
int i;
|
||||||
win_T *wp;
|
|
||||||
|
|
||||||
if (buf->b_ffname == NULL)
|
if (buf->b_ffname == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -512,10 +511,10 @@ void fmarks_check_names(buf_T *buf)
|
|||||||
for (i = 0; i < NMARKS + EXTRA_MARKS; ++i)
|
for (i = 0; i < NMARKS + EXTRA_MARKS; ++i)
|
||||||
fmarks_check_one(&namedfm[i], name, buf);
|
fmarks_check_one(&namedfm[i], name, buf);
|
||||||
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
for (i = 0; i < wp->w_jumplistlen; ++i) {
|
||||||
for (i = 0; i < wp->w_jumplistlen; ++i)
|
|
||||||
fmarks_check_one(&wp->w_jumplist[i], name, buf);
|
fmarks_check_one(&wp->w_jumplist[i], name, buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(name);
|
free(name);
|
||||||
@@ -1042,7 +1041,6 @@ void mark_col_adjust(linenr_T lnum, colnr_T mincol, long lnum_amount, long col_a
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int fnum = curbuf->b_fnum;
|
int fnum = curbuf->b_fnum;
|
||||||
win_T *win;
|
|
||||||
pos_T *posp;
|
pos_T *posp;
|
||||||
|
|
||||||
if ((col_amount == 0L && lnum_amount == 0L) || cmdmod.lockmarks)
|
if ((col_amount == 0L && lnum_amount == 0L) || cmdmod.lockmarks)
|
||||||
@@ -1085,22 +1083,26 @@ void mark_col_adjust(linenr_T lnum, colnr_T mincol, long lnum_amount, long col_a
|
|||||||
/*
|
/*
|
||||||
* Adjust items in all windows related to the current buffer.
|
* Adjust items in all windows related to the current buffer.
|
||||||
*/
|
*/
|
||||||
FOR_ALL_WINDOWS(win)
|
FOR_ALL_WINDOWS(win) {
|
||||||
{
|
|
||||||
/* marks in the jumplist */
|
/* marks in the jumplist */
|
||||||
for (i = 0; i < win->w_jumplistlen; ++i)
|
for (i = 0; i < win->w_jumplistlen; ++i) {
|
||||||
if (win->w_jumplist[i].fmark.fnum == fnum)
|
if (win->w_jumplist[i].fmark.fnum == fnum) {
|
||||||
col_adjust(&(win->w_jumplist[i].fmark.mark));
|
col_adjust(&(win->w_jumplist[i].fmark.mark));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (win->w_buffer == curbuf) {
|
if (win->w_buffer == curbuf) {
|
||||||
/* marks in the tag stack */
|
/* marks in the tag stack */
|
||||||
for (i = 0; i < win->w_tagstacklen; i++)
|
for (i = 0; i < win->w_tagstacklen; i++) {
|
||||||
if (win->w_tagstack[i].fmark.fnum == fnum)
|
if (win->w_tagstack[i].fmark.fnum == fnum) {
|
||||||
col_adjust(&(win->w_tagstack[i].fmark.mark));
|
col_adjust(&(win->w_tagstack[i].fmark.mark));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* cursor position for other windows with the same buffer */
|
/* cursor position for other windows with the same buffer */
|
||||||
if (win != curwin)
|
if (win != curwin) {
|
||||||
col_adjust(&win->w_cursor);
|
col_adjust(&win->w_cursor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1526,10 +1528,7 @@ void copy_viminfo_marks(vir_T *virp, FILE *fp_out, int count, int eof, int flags
|
|||||||
fputs((char *)line, fp_out);
|
fputs((char *)line, fp_out);
|
||||||
}
|
}
|
||||||
if (load_marks) {
|
if (load_marks) {
|
||||||
win_T *wp;
|
FOR_ALL_WINDOWS(wp) {
|
||||||
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
|
||||||
{
|
|
||||||
if (wp->w_buffer == curbuf)
|
if (wp->w_buffer == curbuf)
|
||||||
wp->w_changelistidx = curbuf->b_changelistlen;
|
wp->w_changelistidx = curbuf->b_changelistlen;
|
||||||
}
|
}
|
||||||
|
@@ -4008,12 +4008,9 @@ dozet:
|
|||||||
|
|
||||||
/* Redraw when 'foldenable' changed */
|
/* Redraw when 'foldenable' changed */
|
||||||
if (old_fen != curwin->w_p_fen) {
|
if (old_fen != curwin->w_p_fen) {
|
||||||
win_T *wp;
|
|
||||||
|
|
||||||
if (foldmethodIsDiff(curwin) && curwin->w_p_scb) {
|
if (foldmethodIsDiff(curwin) && curwin->w_p_scb) {
|
||||||
/* Adjust 'foldenable' in diff-synced windows. */
|
/* Adjust 'foldenable' in diff-synced windows. */
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
|
||||||
if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb) {
|
if (wp != curwin && foldmethodIsDiff(wp) && wp->w_p_scb) {
|
||||||
wp->w_p_fen = curwin->w_p_fen;
|
wp->w_p_fen = curwin->w_p_fen;
|
||||||
changed_window_setting_win(wp);
|
changed_window_setting_win(wp);
|
||||||
|
@@ -3698,17 +3698,15 @@ op_format (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oap->is_VIsual) {
|
if (oap->is_VIsual) {
|
||||||
win_T *wp;
|
FOR_ALL_WINDOWS(wp) {
|
||||||
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
|
||||||
{
|
|
||||||
if (wp->w_old_cursor_lnum != 0) {
|
if (wp->w_old_cursor_lnum != 0) {
|
||||||
/* When lines have been inserted or deleted, adjust the end of
|
/* When lines have been inserted or deleted, adjust the end of
|
||||||
* the Visual area to be redrawn. */
|
* the Visual area to be redrawn. */
|
||||||
if (wp->w_old_cursor_lnum > wp->w_old_visual_lnum)
|
if (wp->w_old_cursor_lnum > wp->w_old_visual_lnum) {
|
||||||
wp->w_old_cursor_lnum += old_line_count;
|
wp->w_old_cursor_lnum += old_line_count;
|
||||||
else
|
} else {
|
||||||
wp->w_old_visual_lnum += old_line_count;
|
wp->w_old_visual_lnum += old_line_count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4306,7 +4306,6 @@ did_set_string_option (
|
|||||||
/* When 'spelllang' or 'spellfile' is set and there is a window for this
|
/* When 'spelllang' or 'spellfile' is set and there is a window for this
|
||||||
* buffer in which 'spell' is set load the wordlists. */
|
* buffer in which 'spell' is set load the wordlists. */
|
||||||
else if (varp == &(curbuf->b_s.b_p_spl) || varp == &(curbuf->b_s.b_p_spf)) {
|
else if (varp == &(curbuf->b_s.b_p_spl) || varp == &(curbuf->b_s.b_p_spf)) {
|
||||||
win_T *wp;
|
|
||||||
int l;
|
int l;
|
||||||
|
|
||||||
if (varp == &(curbuf->b_s.b_p_spf)) {
|
if (varp == &(curbuf->b_s.b_p_spf)) {
|
||||||
@@ -4317,10 +4316,11 @@ did_set_string_option (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (errmsg == NULL) {
|
if (errmsg == NULL) {
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
if (wp->w_buffer == curbuf && wp->w_p_spell) {
|
if (wp->w_buffer == curbuf && wp->w_p_spell) {
|
||||||
errmsg = did_set_spelllang(wp);
|
errmsg = did_set_spelllang(wp);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1294,7 +1294,7 @@ void qf_jump(qf_info_T *qi, int dir, int errornr, int forceit)
|
|||||||
int len;
|
int len;
|
||||||
int old_KeyTyped = KeyTyped; /* getting file may reset it */
|
int old_KeyTyped = KeyTyped; /* getting file may reset it */
|
||||||
int ok = OK;
|
int ok = OK;
|
||||||
int usable_win;
|
bool usable_win;
|
||||||
|
|
||||||
if (qi == NULL)
|
if (qi == NULL)
|
||||||
qi = &ql_info;
|
qi = &ql_info;
|
||||||
@@ -1433,26 +1433,29 @@ void qf_jump(qf_info_T *qi, int dir, int errornr, int forceit)
|
|||||||
if (qf_ptr->qf_fnum == 0)
|
if (qf_ptr->qf_fnum == 0)
|
||||||
goto theend;
|
goto theend;
|
||||||
|
|
||||||
usable_win = 0;
|
usable_win = false;
|
||||||
|
|
||||||
ll_ref = curwin->w_llist_ref;
|
ll_ref = curwin->w_llist_ref;
|
||||||
if (ll_ref != NULL) {
|
if (ll_ref != NULL) {
|
||||||
/* Find a window using the same location list that is not a
|
/* Find a window using the same location list that is not a
|
||||||
* quickfix window. */
|
* quickfix window. */
|
||||||
FOR_ALL_WINDOWS(usable_win_ptr)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
if (usable_win_ptr->w_llist == ll_ref
|
if (wp->w_llist == ll_ref
|
||||||
&& usable_win_ptr->w_buffer->b_p_bt[0] != 'q') {
|
&& wp->w_buffer->b_p_bt[0] != 'q') {
|
||||||
usable_win = 1;
|
usable_win = true;
|
||||||
break;
|
usable_win_ptr = wp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!usable_win) {
|
if (!usable_win) {
|
||||||
/* Locate a window showing a normal buffer */
|
/* Locate a window showing a normal buffer */
|
||||||
FOR_ALL_WINDOWS(win)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
if (win->w_buffer->b_p_bt[0] == NUL) {
|
if (wp->w_buffer->b_p_bt[0] == NUL) {
|
||||||
usable_win = 1;
|
usable_win = true;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1468,7 +1471,7 @@ void qf_jump(qf_info_T *qi, int dir, int errornr, int forceit)
|
|||||||
{
|
{
|
||||||
if (wp->w_buffer->b_fnum == qf_ptr->qf_fnum) {
|
if (wp->w_buffer->b_fnum == qf_ptr->qf_fnum) {
|
||||||
goto_tabpage_win(tp, wp);
|
goto_tabpage_win(tp, wp);
|
||||||
usable_win = 1;
|
usable_win = true;
|
||||||
goto win_found;
|
goto win_found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1501,9 +1504,12 @@ win_found:
|
|||||||
win = usable_win_ptr;
|
win = usable_win_ptr;
|
||||||
if (win == NULL) {
|
if (win == NULL) {
|
||||||
/* Find the window showing the selected file */
|
/* Find the window showing the selected file */
|
||||||
FOR_ALL_WINDOWS(win)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
if (win->w_buffer->b_fnum == qf_ptr->qf_fnum)
|
if (wp->w_buffer->b_fnum == qf_ptr->qf_fnum) {
|
||||||
break;
|
win = wp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (win == NULL) {
|
if (win == NULL) {
|
||||||
/* Find a previous usable window */
|
/* Find a previous usable window */
|
||||||
win = curwin;
|
win = curwin;
|
||||||
@@ -2212,13 +2218,13 @@ static int is_qf_win(win_T *win, qf_info_T *qi)
|
|||||||
*/
|
*/
|
||||||
static win_T *qf_find_win(qf_info_T *qi)
|
static win_T *qf_find_win(qf_info_T *qi)
|
||||||
{
|
{
|
||||||
win_T *win;
|
FOR_ALL_WINDOWS(win) {
|
||||||
|
if (is_qf_win(win, qi)) {
|
||||||
|
return win;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FOR_ALL_WINDOWS(win)
|
return NULL;
|
||||||
if (is_qf_win(win, qi))
|
|
||||||
break;
|
|
||||||
|
|
||||||
return win;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -3478,7 +3484,6 @@ void ex_helpgrep(exarg_T *eap)
|
|||||||
char_u *lang;
|
char_u *lang;
|
||||||
qf_info_T *qi = &ql_info;
|
qf_info_T *qi = &ql_info;
|
||||||
int new_qi = FALSE;
|
int new_qi = FALSE;
|
||||||
win_T *wp;
|
|
||||||
char_u *au_name = NULL;
|
char_u *au_name = NULL;
|
||||||
|
|
||||||
/* Check for a specified language */
|
/* Check for a specified language */
|
||||||
@@ -3501,16 +3506,16 @@ void ex_helpgrep(exarg_T *eap)
|
|||||||
p_cpo = empty_option;
|
p_cpo = empty_option;
|
||||||
|
|
||||||
if (eap->cmdidx == CMD_lhelpgrep) {
|
if (eap->cmdidx == CMD_lhelpgrep) {
|
||||||
|
qi = NULL;
|
||||||
|
|
||||||
/* Find an existing help window */
|
/* Find an existing help window */
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
if (wp->w_buffer != NULL && wp->w_buffer->b_help)
|
if (wp->w_buffer != NULL && wp->w_buffer->b_help) {
|
||||||
break;
|
qi = wp->w_llist;
|
||||||
|
}
|
||||||
if (wp == NULL) /* Help window not found */
|
}
|
||||||
qi = NULL;
|
|
||||||
else
|
|
||||||
qi = wp->w_llist;
|
|
||||||
|
|
||||||
|
/* Help window not found */
|
||||||
if (qi == NULL) {
|
if (qi == NULL) {
|
||||||
/* Allocate a new location list for help text matches */
|
/* Allocate a new location list for help text matches */
|
||||||
qi = ll_new_list();
|
qi = ll_new_list();
|
||||||
|
@@ -206,10 +206,7 @@ void redraw_later_clear(void)
|
|||||||
*/
|
*/
|
||||||
void redraw_all_later(int type)
|
void redraw_all_later(int type)
|
||||||
{
|
{
|
||||||
win_T *wp;
|
FOR_ALL_WINDOWS(wp) {
|
||||||
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
|
||||||
{
|
|
||||||
redraw_win_later(wp, type);
|
redraw_win_later(wp, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -224,12 +221,10 @@ void redraw_curbuf_later(int type)
|
|||||||
|
|
||||||
void redraw_buf_later(buf_T *buf, int type)
|
void redraw_buf_later(buf_T *buf, int type)
|
||||||
{
|
{
|
||||||
win_T *wp;
|
FOR_ALL_WINDOWS(wp) {
|
||||||
|
if (wp->w_buffer == buf) {
|
||||||
FOR_ALL_WINDOWS(wp)
|
|
||||||
{
|
|
||||||
if (wp->w_buffer == buf)
|
|
||||||
redraw_win_later(wp, type);
|
redraw_win_later(wp, type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -390,7 +385,6 @@ void update_curbuf(int type)
|
|||||||
*/
|
*/
|
||||||
void update_screen(int type)
|
void update_screen(int type)
|
||||||
{
|
{
|
||||||
win_T *wp;
|
|
||||||
static int did_intro = FALSE;
|
static int did_intro = FALSE;
|
||||||
int did_one;
|
int did_one;
|
||||||
|
|
||||||
@@ -438,8 +432,7 @@ void update_screen(int type)
|
|||||||
check_for_delay(FALSE);
|
check_for_delay(FALSE);
|
||||||
if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, NULL) == FAIL)
|
if (screen_ins_lines(0, 0, msg_scrolled, (int)Rows, NULL) == FAIL)
|
||||||
type = CLEAR;
|
type = CLEAR;
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
|
||||||
if (wp->w_winrow < msg_scrolled) {
|
if (wp->w_winrow < msg_scrolled) {
|
||||||
if (wp->w_winrow + wp->w_height > msg_scrolled
|
if (wp->w_winrow + wp->w_height > msg_scrolled
|
||||||
&& wp->w_redr_type < REDRAW_TOP
|
&& wp->w_redr_type < REDRAW_TOP
|
||||||
@@ -450,8 +443,9 @@ void update_screen(int type)
|
|||||||
} else {
|
} else {
|
||||||
wp->w_redr_type = NOT_VALID;
|
wp->w_redr_type = NOT_VALID;
|
||||||
if (wp->w_winrow + wp->w_height + wp->w_status_height
|
if (wp->w_winrow + wp->w_height + wp->w_status_height
|
||||||
<= msg_scrolled)
|
<= msg_scrolled) {
|
||||||
wp->w_redr_status = TRUE;
|
wp->w_redr_status = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -512,8 +506,7 @@ void update_screen(int type)
|
|||||||
* Correct stored syntax highlighting info for changes in each displayed
|
* Correct stored syntax highlighting info for changes in each displayed
|
||||||
* buffer. Each buffer must only be done once.
|
* buffer. Each buffer must only be done once.
|
||||||
*/
|
*/
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
|
||||||
if (wp->w_buffer->b_mod_set) {
|
if (wp->w_buffer->b_mod_set) {
|
||||||
win_T *wwp;
|
win_T *wwp;
|
||||||
|
|
||||||
@@ -534,8 +527,7 @@ void update_screen(int type)
|
|||||||
*/
|
*/
|
||||||
did_one = FALSE;
|
did_one = FALSE;
|
||||||
search_hl.rm.regprog = NULL;
|
search_hl.rm.regprog = NULL;
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
|
||||||
if (wp->w_redr_type != 0) {
|
if (wp->w_redr_type != 0) {
|
||||||
cursor_off();
|
cursor_off();
|
||||||
if (!did_one) {
|
if (!did_one) {
|
||||||
@@ -558,8 +550,9 @@ void update_screen(int type)
|
|||||||
|
|
||||||
/* Reset b_mod_set flags. Going through all windows is probably faster
|
/* Reset b_mod_set flags. Going through all windows is probably faster
|
||||||
* than going through all buffers (there could be many buffers). */
|
* than going through all buffers (there could be many buffers). */
|
||||||
for (wp = firstwin; wp != NULL; wp = wp->w_next)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
wp->w_buffer->b_mod_set = FALSE;
|
wp->w_buffer->b_mod_set = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
updating_screen = FALSE;
|
updating_screen = FALSE;
|
||||||
|
|
||||||
@@ -662,31 +655,28 @@ static void update_finish(void)
|
|||||||
|
|
||||||
void update_debug_sign(buf_T *buf, linenr_T lnum)
|
void update_debug_sign(buf_T *buf, linenr_T lnum)
|
||||||
{
|
{
|
||||||
win_T *wp;
|
|
||||||
int doit = FALSE;
|
int doit = FALSE;
|
||||||
win_foldinfo.fi_level = 0;
|
win_foldinfo.fi_level = 0;
|
||||||
|
|
||||||
/* update/delete a specific mark */
|
/* update/delete a specific mark */
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
if (buf != NULL && lnum > 0) {
|
||||||
if (buf != NULL && lnum > 0) {
|
if (wp->w_buffer == buf && lnum >= wp->w_topline
|
||||||
if (wp->w_buffer == buf && lnum >= wp->w_topline
|
&& lnum < wp->w_botline) {
|
||||||
&& lnum < wp->w_botline)
|
if (wp->w_redraw_top == 0 || wp->w_redraw_top > lnum) {
|
||||||
{
|
wp->w_redraw_top = lnum;
|
||||||
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;
|
||||||
if (wp->w_redraw_bot == 0 || wp->w_redraw_bot < lnum) {
|
}
|
||||||
wp->w_redraw_bot = lnum;
|
redraw_win_later(wp, VALID);
|
||||||
}
|
|
||||||
redraw_win_later(wp, VALID);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
redraw_win_later(wp, VALID);
|
|
||||||
}
|
|
||||||
if (wp->w_redr_type != 0) {
|
|
||||||
doit = TRUE;
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
redraw_win_later(wp, VALID);
|
||||||
|
}
|
||||||
|
if (wp->w_redr_type != 0) {
|
||||||
|
doit = TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return when there is nothing to do, screen updating is already
|
/* Return when there is nothing to do, screen updating is already
|
||||||
@@ -698,13 +688,13 @@ void update_debug_sign(buf_T *buf, linenr_T lnum)
|
|||||||
/* update all windows that need updating */
|
/* update all windows that need updating */
|
||||||
update_prepare();
|
update_prepare();
|
||||||
|
|
||||||
for (wp = firstwin; wp; wp = wp->w_next) {
|
FOR_ALL_WINDOWS(wp) {
|
||||||
if (wp->w_redr_type != 0) {
|
if (wp->w_redr_type != 0) {
|
||||||
win_update(wp);
|
win_update(wp);
|
||||||
}
|
}
|
||||||
if (wp->w_redr_status) {
|
if (wp->w_redr_status) {
|
||||||
win_redr_status(wp);
|
win_redr_status(wp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
update_finish();
|
update_finish();
|
||||||
|
@@ -984,16 +984,13 @@ static void syn_stack_free_block(synblock_T *block)
|
|||||||
*/
|
*/
|
||||||
void syn_stack_free_all(synblock_T *block)
|
void syn_stack_free_all(synblock_T *block)
|
||||||
{
|
{
|
||||||
win_T *wp;
|
|
||||||
|
|
||||||
syn_stack_free_block(block);
|
syn_stack_free_block(block);
|
||||||
|
|
||||||
|
|
||||||
/* When using "syntax" fold method, must update all folds. */
|
/* When using "syntax" fold method, must update all folds. */
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
if (wp->w_s == block && foldmethodIsSyntax(wp)) {
|
||||||
if (wp->w_s == block && foldmethodIsSyntax(wp))
|
|
||||||
foldUpdateAll(wp);
|
foldUpdateAll(wp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1075,14 +1072,12 @@ static void syn_stack_alloc(void)
|
|||||||
*/
|
*/
|
||||||
void syn_stack_apply_changes(buf_T *buf)
|
void syn_stack_apply_changes(buf_T *buf)
|
||||||
{
|
{
|
||||||
win_T *wp;
|
|
||||||
|
|
||||||
syn_stack_apply_changes_block(&buf->b_s, buf);
|
syn_stack_apply_changes_block(&buf->b_s, buf);
|
||||||
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
if ((wp->w_buffer == buf) && (wp->w_s != &buf->b_s)) {
|
||||||
if ((wp->w_buffer == buf) && (wp->w_s != &buf->b_s))
|
|
||||||
syn_stack_apply_changes_block(wp->w_s, buf);
|
syn_stack_apply_changes_block(wp->w_s, buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2191,12 +2191,10 @@ u_undo_end (
|
|||||||
u_add_time(msgbuf, sizeof(msgbuf), uhp->uh_time);
|
u_add_time(msgbuf, sizeof(msgbuf), uhp->uh_time);
|
||||||
|
|
||||||
{
|
{
|
||||||
win_T *wp;
|
FOR_ALL_WINDOWS(wp) {
|
||||||
|
if (wp->w_buffer == curbuf && wp->w_p_cole > 0) {
|
||||||
FOR_ALL_WINDOWS(wp)
|
|
||||||
{
|
|
||||||
if (wp->w_buffer == curbuf && wp->w_p_cole > 0)
|
|
||||||
redraw_win_later(wp, NOT_VALID);
|
redraw_win_later(wp, NOT_VALID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1677,20 +1677,19 @@ static int last_window(void)
|
|||||||
* Return TRUE if there is only one window other than "aucmd_win" in the
|
* Return TRUE if there is only one window other than "aucmd_win" in the
|
||||||
* current tab page.
|
* current tab page.
|
||||||
*/
|
*/
|
||||||
int one_window(void)
|
bool one_window(void)
|
||||||
{
|
{
|
||||||
win_T *wp;
|
bool seen_one = false;
|
||||||
int seen_one = FALSE;
|
|
||||||
|
|
||||||
FOR_ALL_WINDOWS(wp)
|
FOR_ALL_WINDOWS(wp) {
|
||||||
{
|
|
||||||
if (wp != aucmd_win) {
|
if (wp != aucmd_win) {
|
||||||
if (seen_one)
|
if (seen_one) {
|
||||||
return FALSE;
|
return false;
|
||||||
seen_one = TRUE;
|
}
|
||||||
|
seen_one = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user