Problem: FOR_ALL_ macros are defined in an unexpected file.
Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS.
(Yegappan Lakshmanan, closes #12109)
// Lock the hashtab, we don't want it to resize while freeing items.
hash_lock(ht);
todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
ga_append(&ga, '{');
todo = (int)d->dv_hashtab.ht_used;
- for (hi = d->dv_hashtab.ht_array; todo > 0 && !got_int; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&d->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
type = NULL;
todo = (int)d2->dv_hashtab.ht_used;
- for (hashitem_T *hi2 = d2->dv_hashtab.ht_array; todo > 0; ++hi2)
+ hashitem_T *hi2;
+ FOR_ALL_HASHTAB_ITEMS(&d2->dv_hashtab, hi2, todo)
{
if (!HASHITEM_EMPTY(hi2))
{
return FALSE;
todo = (int)d1->dv_hashtab.ht_used;
- for (hi = d1->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&d1->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
return 0;
todo = (int)d->dv_hashtab.ht_used;
- for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&d->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
ht = &d->dv_hashtab;
hash_lock(ht);
todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
return;
todo = (int)d->dv_hashtab.ht_used;
- for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&d->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
hashitem_T *hi;
// Set readonly
- for (hi = di->dv_hashtab.ht_array; todo > 0 ; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&di->dv_hashtab, hi, todo)
{
if (HASHITEM_EMPTY(hi))
continue;
{
diff_T *dp;
- for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next)
+ FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp)
if (dp == diff)
return TRUE;
return FALSE;
// it is added to ht_stack, if it contains a list it is added to
// list_stack.
todo = (int)cur_ht->ht_used;
- for (hi = cur_ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(cur_ht, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
--todo;
if (d != NULL)
{
todo = (int)d->dv_hashtab.ht_used;
- for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&d->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
{
// recursive: lock/unlock the items the List contains
todo = (int)d->dv_hashtab.ht_used;
- for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&d->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
hash_lock(ht);
todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
* overruling of menus that the user already defined.
*/
EXTERN int sys_menu INIT(= FALSE);
-
-#define FOR_ALL_MENUS(m) for ((m) = root_menu; (m) != NULL; (m) = (m)->next)
-#define FOR_ALL_CHILD_MENUS(p, c) \
- for ((c) = (p)->children; (c) != NULL; (c) = (c)->next)
#endif
#ifdef FEAT_GUI
EXTERN win_T *prevwin INIT(= NULL); // previous window
#define ONE_WINDOW (firstwin == lastwin)
#define W_NEXT(wp) ((wp)->w_next)
-#define FOR_ALL_WINDOWS(wp) for ((wp) = firstwin; (wp) != NULL; (wp) = (wp)->w_next)
-#define FOR_ALL_FRAMES(frp, first_frame) \
- for ((frp) = first_frame; (frp) != NULL; (frp) = (frp)->fr_next)
-#define FOR_ALL_TABPAGES(tp) for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next)
-#define FOR_ALL_WINDOWS_IN_TAB(tp, wp) \
- for ((wp) = ((tp) == NULL || (tp) == curtab) \
- ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
-/*
- * When using this macro "break" only breaks out of the inner loop. Use "goto"
- * to break out of the tabpage loop.
- */
-#define FOR_ALL_TAB_WINDOWS(tp, wp) \
- for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
- for ((wp) = ((tp) == curtab) \
- ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
-
-#define FOR_ALL_POPUPWINS(wp) \
- for ((wp) = first_popupwin; (wp) != NULL; (wp) = (wp)->w_next)
-#define FOR_ALL_POPUPWINS_IN_TAB(tp, wp) \
- for ((wp) = (tp)->tp_first_popupwin; (wp) != NULL; (wp) = (wp)->w_next)
-
EXTERN win_T *curwin; // currently active window
EXTERN buf_T *lastbuf INIT(= NULL); // last buffer
EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer
-#define FOR_ALL_BUFFERS(buf) \
- for ((buf) = firstbuf; (buf) != NULL; (buf) = (buf)->b_next)
-
-#define FOR_ALL_BUF_WININFO(buf, wip) \
- for ((wip) = (buf)->b_wininfo; (wip) != NULL; (wip) = (wip)->wi_next)
-
-// Iterate through all the signs placed in a buffer
-#define FOR_ALL_SIGNS_IN_BUF(buf, sign) \
- for ((sign) = (buf)->b_signlist; (sign) != NULL; (sign) = (sign)->se_next)
-
// Flag that is set when switching off 'swapfile'. It means that all blocks
// are to be loaded into memory. Shouldn't be global...
EXTERN int mf_dont_release INIT(= FALSE); // don't release blocks
// Line in which spell checking wasn't highlighted because it touched the
// cursor position in Insert mode.
EXTERN linenr_T spell_redraw_lnum INIT(= 0);
-
-#define FOR_ALL_SPELL_LANGS(slang) \
- for ((slang) = first_lang; (slang) != NULL; (slang) = (slang)->sl_next)
#endif
#ifdef FEAT_CONCEAL
// Whether a redraw is needed for appending a line to a buffer.
EXTERN int channel_need_redraw INIT(= FALSE);
-
-# define FOR_ALL_CHANNELS(ch) \
- for ((ch) = first_channel; (ch) != NULL; (ch) = (ch)->ch_next)
-# define FOR_ALL_JOBS(job) \
- for ((job) = first_job; (job) != NULL; (job) = (job)->jv_next)
#endif
#ifdef FEAT_EVAL
# define REPEATED_MSG_SAFESTATE 2
#endif
-#if defined(FEAT_DIFF)
-#define FOR_ALL_DIFFBLOCKS_IN_TAB(tp, dp) \
- for ((dp) = (tp)->tp_first_diff; (dp) != NULL; (dp) = (dp)->df_next)
-#endif
-
-#define FOR_ALL_LIST_ITEMS(l, li) \
- for ((li) = (l) == NULL ? NULL : (l)->lv_first; (li) != NULL; (li) = (li)->li_next)
-
// While executing a regexp and set to OPTION_MAGIC_ON or OPTION_MAGIC_OFF this
// overrules p_magic. Otherwise set to OPTION_MAGIC_NOT_SET.
EXTERN optmagic_T magic_overruled INIT(= OPTION_MAGIC_NOT_SET);
hashitem_T *hi;
todo = (long)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
hashitem_T *hi;
dictitem_T *di;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
hashitem_T *hi;
dictitem_T *di;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
return OK;
todo = (int)dict->dv_hashtab.ht_used;
- for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&dict->dv_hashtab, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
item = &dict_lookup(hi)->di_tv;
// Length of the array.
#define ARRAY_LENGTH(a) (sizeof(a) / sizeof((a)[0]))
+
+#ifdef FEAT_MENU
+#define FOR_ALL_MENUS(m) \
+ for ((m) = root_menu; (m) != NULL; (m) = (m)->next)
+#define FOR_ALL_CHILD_MENUS(p, c) \
+ for ((c) = (p)->children; (c) != NULL; (c) = (c)->next)
+#endif
+
+#define FOR_ALL_WINDOWS(wp) \
+ for ((wp) = firstwin; (wp) != NULL; (wp) = (wp)->w_next)
+#define FOR_ALL_FRAMES(frp, first_frame) \
+ for ((frp) = first_frame; (frp) != NULL; (frp) = (frp)->fr_next)
+#define FOR_ALL_TABPAGES(tp) \
+ for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next)
+#define FOR_ALL_WINDOWS_IN_TAB(tp, wp) \
+ for ((wp) = ((tp) == NULL || (tp) == curtab) \
+ ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
+/*
+ * When using this macro "break" only breaks out of the inner loop. Use "goto"
+ * to break out of the tabpage loop.
+ */
+#define FOR_ALL_TAB_WINDOWS(tp, wp) \
+ for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
+ for ((wp) = ((tp) == curtab) \
+ ? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
+
+#define FOR_ALL_POPUPWINS(wp) \
+ for ((wp) = first_popupwin; (wp) != NULL; (wp) = (wp)->w_next)
+#define FOR_ALL_POPUPWINS_IN_TAB(tp, wp) \
+ for ((wp) = (tp)->tp_first_popupwin; (wp) != NULL; (wp) = (wp)->w_next)
+
+#define FOR_ALL_BUFFERS(buf) \
+ for ((buf) = firstbuf; (buf) != NULL; (buf) = (buf)->b_next)
+
+#define FOR_ALL_BUF_WININFO(buf, wip) \
+ for ((wip) = (buf)->b_wininfo; (wip) != NULL; (wip) = (wip)->wi_next)
+
+// Iterate through all the signs placed in a buffer
+#define FOR_ALL_SIGNS_IN_BUF(buf, sign) \
+ for ((sign) = (buf)->b_signlist; (sign) != NULL; (sign) = (sign)->se_next)
+
+#ifdef FEAT_SPELL
+#define FOR_ALL_SPELL_LANGS(slang) \
+ for ((slang) = first_lang; (slang) != NULL; (slang) = (slang)->sl_next)
+#endif
+
+// Iterate over all the items in a List
+#define FOR_ALL_LIST_ITEMS(l, li) \
+ for ((li) = (l) == NULL ? NULL : (l)->lv_first; (li) != NULL; (li) = (li)->li_next)
+
+// Iterate over all the items in a hash table
+#define FOR_ALL_HASHTAB_ITEMS(ht, hi, todo) \
+ for ((hi) = (ht)->ht_array; (todo) > 0; ++(hi))
// values of them.
//
// Note that these symbols are of varying widths, as they are symbols
- // representing differents things ranging from a simple gear icon to an
+ // representing different things ranging from a simple gear icon to an
// airplane. Some of them are in fact wider than double-width, but Vim
// doesn't support non-fixed-width font, and tagging them as
// double-width is the best way to handle them.
// Check that all entries are a list with three numbers, the range is
// valid and the cell width is valid.
item = 0;
- for (li = l->lv_first; li != NULL; li = li->li_next)
+ FOR_ALL_LIST_ITEMS(l, li)
{
listitem_T *lili;
varnumber_T n1;
{
int do_push_pop = unix_did_set_title || did_set_icon;
- // only restore the title or icon when it has been set
- mch_settitle(((which & SAVE_RESTORE_TITLE) && unix_did_set_title) ?
- (oldtitle ? oldtitle : p_titleold) : NULL,
+ // Only restore the title or icon when it has been set.
+ // When using "oldtitle" make a copy, it might be freed halfway.
+ char_u *title = ((which & SAVE_RESTORE_TITLE) && unix_did_set_title)
+ ? (oldtitle ? oldtitle : p_titleold) : NULL;
+ char_u *tofree = NULL;
+ if (title == oldtitle && oldtitle != NULL)
+ {
+ tofree = vim_strsave(title);
+ if (tofree != NULL)
+ title = tofree;
+ }
+ mch_settitle(title,
((which & SAVE_RESTORE_ICON) && did_set_icon) ? oldicon : NULL);
+ vim_free(tofree);
if (do_push_pop)
{
hashitem_T *hi;
int todo = (int)dict->dv_hashtab.ht_used;
- for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&dict->dv_hashtab, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
typval_T *item = &dict_lookup(hi)->di_tv;
if (mods)
{
// If "modifiers" is explicitly set in the args, then we reset any
- // remembered modifer key state that may have been set from earlier
- // mod-key-down events, even if they are not yet unset by earlier
- // mod-key-up events.
+ // remembered modifier key state that may have been set from
+ // earlier mod-key-down events, even if they are not yet unset by
+ // earlier mod-key-up events.
s_dwMods = 0;
if (mods & MOD_MASK_SHIFT)
ker.dwControlKeyState |= SHIFT_PRESSED;
}
// Ideally, WriteConsoleInput would be used to inject these low-level
- // events. But, this doesnt work well in the CI test environment. So
+ // events. But, this doesn't work well in the CI test environment. So
// implementing an input_record_buffer instead.
if (input_encoded)
lpEventsWritten = write_input_record_buffer(&ir, 1);
if (env != NULL)
{
- for (hi = env->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&env->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
win_enter(owp, FALSE);
else
{
- for (owp = curtab->tp_first_popupwin; owp != NULL;
- owp = owp->w_next)
+ FOR_ALL_POPUPWINS_IN_TAB(curtab, owp)
if (owp != curwin && owp->w_buffer->b_term != NULL)
break;
if (owp != NULL)
functbl = func_tbl_get();
todo = (int)functbl->ht_used;
- for (hi = functbl->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(functbl, hi, todo)
{
ufunc_T *fp;
int i;
sorttab = ALLOC_MULT(ufunc_T *, todo);
- for (hi = functbl->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(functbl, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
// is encountered without the "noclear" argument.
ht = &SCRIPT_VARS(sid);
todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
--todo;
// looking for functions with script ID 'sid'.
functbl = func_tbl_get();
todo = functbl->ht_used;
- for (hi = functbl->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(functbl, hi, todo)
{
ufunc_T *fp;
char_u *p, *t;
todo = (int)gvht->ht_used;
- for (hi = gvht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(gvht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
// Complete with name of sign groups already defined
current_idx = 0;
todo = (int)sg_table.ht_used;
- for (hi = sg_table.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&sg_table, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
for (ht = &aff->af_pref; ; ht = &aff->af_suff)
{
todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
hashitem_T *hi;
todo = (int)spin->si_commonwords.ht_used;
- for (hi = spin->si_commonwords.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&spin->si_commonwords, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
l = (int)STRLEN(hi->hi_key) + 1;
{
// Free the info about handled words.
todo = (int)slang->sl_sounddone.ht_used;
- for (hi = slang->sl_sounddone.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&slang->sl_sounddone, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
vim_free(HI2SFT(hi));
hash_lock(ht);
todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
keyentry_T *kp_next;
todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
return;
todo = (int)exp_d->dv_hashtab.ht_used;
- for (hi = exp_d->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&exp_d->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
// Add items only present in got_d.
todo = (int)got_d->dv_hashtab.ht_used;
- for (hi = got_d->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&got_d->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
static textprop_T *text_prop_compare_props;
static buf_T *text_prop_compare_buf;
-/* Score for sorting on position of the text property: 0: above,
+/*
+ * Score for sorting on position of the text property: 0: above,
* 1: after (default), 2: right, 3: below (comes last)
*/
static int
if (*array == NULL)
return NULL;
todo = (long)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
hash_remove(ht, hi, "prop type delete");
vim_free(prop);
- // currently visibile text properties will disappear
+ // currently visible text properties will disappear
redraw_all_later(UPD_CLEAR);
changed_window_setting_buf(buf == NULL ? curbuf : buf);
}
hashitem_T *hi;
todo = (long)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
return;
todo = (long)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
// Make a copy of the a: variables, since we didn't do that above.
todo = (int)fc->fc_l_avars.dv_hashtab.ht_used;
- for (hi = fc->fc_l_avars.dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&fc->fc_l_avars.dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
while (todo > 0)
{
todo = func_hashtab.ht_used;
- for (hi = func_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&func_hashtab, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
fp = HI2UF(hi);
while (todo > 0)
{
todo = func_hashtab.ht_used;
- for (hi = func_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&func_hashtab, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
// clear the def function index now
while (func_hashtab.ht_used > skipped)
{
todo = func_hashtab.ht_used;
- for (hi = func_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&func_hashtab, hi, todo)
if (!HASHITEM_EMPTY(hi))
{
--todo;
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1390,
/**/
1389,
/**/
if (defer_tv->v_type != VAR_LIST)
return; // no function added
- for (li = defer_tv->vval.v_list->lv_first; li != NULL; li = li->li_next)
+ FOR_ALL_LIST_ITEMS(defer_tv->vval.v_list, li)
{
list_T *l = li->li_tv.vval.v_list;
typval_T rettv;
hash_lock(ht);
todo = (int)ht->ht_used;
- for (hi = ht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
hashitem_T *hi;
dictitem_T *di;
- for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(&d->dv_hashtab, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
fputs(_("\n# global variables:\n"), fp);
todo = (int)gvht->ht_used;
- for (hi = gvht->ht_array; todo > 0; ++hi)
+ FOR_ALL_HASHTAB_ITEMS(gvht, hi, todo)
{
if (!HASHITEM_EMPTY(hi))
{
// If there already is an entry with "wi_win" set to NULL it
// must be removed, it would never be used.
// Skip "wip" itself, otherwise Coverity complains.
- for (wip2 = buf->b_wininfo; wip2 != NULL; wip2 = wip2->wi_next)
+ FOR_ALL_BUF_WININFO(buf, wip2)
if (wip2 != wip && wip2->wi_win == NULL)
{
if (wip2->wi_next != NULL)
/*
* A snapshot of the window sizes, to restore them after closing the help
- * window.
+ * or other window.
* Only these fields are used:
* fr_layout
* fr_width
/*
* Create a snapshot of the current frame sizes.
+ * "idx" is SNAP_HELP_IDX or SNAP_AUCMD_IDX.
*/
void
make_snapshot(int idx)
* Restore a previously created snapshot, if there is any.
* This is only done if the screen size didn't change and the window layout is
* still the same.
+ * "idx" is SNAP_HELP_IDX or SNAP_AUCMD_IDX.
*/
void
restore_snapshot(