diff options
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 4d28afd792..072f2fab40 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -9322,26 +9322,30 @@ static frame_T *ses_skipframe(frame_T *fr) { frame_T *frc; - for (frc = fr; frc != NULL; frc = frc->fr_next) - if (ses_do_frame(frc)) + FOR_ALL_FRAMES(frc, fr) { + if (ses_do_frame(frc)) { break; + } + } return frc; } -/* - * Return TRUE if frame "fr" has a window somewhere that we want to save in - * the Session. - */ -static int ses_do_frame(frame_T *fr) +// Return true if frame "fr" has a window somewhere that we want to save in +// the Session. +static bool ses_do_frame(const frame_T *fr) + FUNC_ATTR_NONNULL_ARG(1) { - frame_T *frc; + const frame_T *frc; - if (fr->fr_layout == FR_LEAF) + if (fr->fr_layout == FR_LEAF) { return ses_do_win(fr->fr_win); - for (frc = fr->fr_child; frc != NULL; frc = frc->fr_next) - if (ses_do_frame(frc)) - return TRUE; - return FALSE; + } + FOR_ALL_FRAMES(frc, fr->fr_child) { + if (ses_do_frame(frc)) { + return true; + } + } + return false; } /// Return non-zero if window "wp" is to be stored in the Session. |