vim-patch:8.1.2396: using old C style comments

Problem:    Using old C style comments.
Solution:   Use // comments where appropriate.
e38eab22c1
This commit is contained in:
Dundar Göc 2021-10-06 11:48:09 +02:00
parent acd5e831b6
commit d6c789a571
2 changed files with 118 additions and 120 deletions

View File

@ -69,8 +69,8 @@
* All data is allocated and will all be freed when the buffer is unloaded. * All data is allocated and will all be freed when the buffer is unloaded.
*/ */
/* Uncomment the next line for including the u_check() function. This warns // Uncomment the next line for including the u_check() function. This warns
* for errors in the debug information. */ // for errors in the debug information.
// #define U_DEBUG 1 // #define U_DEBUG 1
#define UH_MAGIC 0x18dade // value for uh_magic when in use #define UH_MAGIC 0x18dade // value for uh_magic when in use
#define UE_MAGIC 0xabc123 // value for ue_magic when in use #define UE_MAGIC 0xabc123 // value for ue_magic when in use
@ -291,8 +291,8 @@ bool undo_allowed(buf_T *buf)
return false; return false;
} }
/* Don't allow changes in the buffer while editing the cmdline. The // Don't allow changes in the buffer while editing the cmdline. The
* caller of getcmdline() may get confused. */ // caller of getcmdline() may get confused.
if (textlock != 0) { if (textlock != 0) {
EMSG(_(e_secure)); EMSG(_(e_secure));
return false; return false;
@ -1921,8 +1921,8 @@ static void u_doit(int startcount, bool quiet, bool do_buf_event)
u_undoredo(false, do_buf_event); u_undoredo(false, do_buf_event);
/* Advance for next redo. Set "newhead" when at the end of the // Advance for next redo. Set "newhead" when at the end of the
* redoable changes. */ // redoable changes.
if (curbuf->b_u_curhead->uh_prev.ptr == NULL) { if (curbuf->b_u_curhead->uh_prev.ptr == NULL) {
curbuf->b_u_newhead = curbuf->b_u_curhead; curbuf->b_u_newhead = curbuf->b_u_curhead;
} }
@ -1967,8 +1967,8 @@ void undo_time(long step, bool sec, bool file, bool absolute)
u_oldcount = -1; u_oldcount = -1;
} }
/* "target" is the node below which we want to be. // "target" is the node below which we want to be.
* Init "closest" to a value we can't reach. */ // Init "closest" to a value we can't reach.
if (absolute) { if (absolute) {
target = step; target = step;
closest = -1; closest = -1;
@ -1977,9 +1977,9 @@ void undo_time(long step, bool sec, bool file, bool absolute)
target = (long)(curbuf->b_u_time_cur) + step; target = (long)(curbuf->b_u_time_cur) + step;
} else if (dofile) { } else if (dofile) {
if (step < 0) { if (step < 0) {
/* Going back to a previous write. If there were changes after // Going back to a previous write. If there were changes after
* the last write, count that as moving one file-write, so // the last write, count that as moving one file-write, so
* that ":earlier 1f" undoes all changes since the last save. */ // that ":earlier 1f" undoes all changes since the last save.
uhp = curbuf->b_u_curhead; uhp = curbuf->b_u_curhead;
if (uhp != NULL) { if (uhp != NULL) {
uhp = uhp->uh_next.ptr; uhp = uhp->uh_next.ptr;
@ -2003,8 +2003,8 @@ void undo_time(long step, bool sec, bool file, bool absolute)
// Moving forward to a newer write. // Moving forward to a newer write.
target = curbuf->b_u_save_nr_cur + step; target = curbuf->b_u_save_nr_cur + step;
if (target > curbuf->b_u_save_nr_last) { if (target > curbuf->b_u_save_nr_last) {
/* Go to after last write: after the latest change. Use // Go to after last write: after the latest change. Use
* the sequence number for that. */ // the sequence number for that.
target = curbuf->b_u_seq_last + 1; target = curbuf->b_u_seq_last + 1;
dofile = false; dofile = false;
} }
@ -2072,10 +2072,10 @@ void undo_time(long step, bool sec, bool file, bool absolute)
} }
if (round == 1 && !(dofile && val == 0)) { if (round == 1 && !(dofile && val == 0)) {
/* Remember the header that is closest to the target. // Remember the header that is closest to the target.
* It must be at least in the right direction (checked with // It must be at least in the right direction (checked with
* "b_u_seq_cur"). When the timestamp is equal find the // "b_u_seq_cur"). When the timestamp is equal find the
* highest/lowest sequence number. */ // highest/lowest sequence number.
if ((step < 0 ? uhp->uh_seq <= curbuf->b_u_seq_cur if ((step < 0 ? uhp->uh_seq <= curbuf->b_u_seq_cur
: uhp->uh_seq > curbuf->b_u_seq_cur) : uhp->uh_seq > curbuf->b_u_seq_cur)
&& ((dosec && val == closest) && ((dosec && val == closest)
@ -2095,8 +2095,8 @@ void undo_time(long step, bool sec, bool file, bool absolute)
} }
} }
/* Quit searching when we found a match. But when searching for a // Quit searching when we found a match. But when searching for a
* time we need to continue looking for the best uh_seq. */ // time we need to continue looking for the best uh_seq.
if (target == val && !dosec) { if (target == val && !dosec) {
target = uhp->uh_seq; target = uhp->uh_seq;
break; break;
@ -2112,12 +2112,11 @@ void undo_time(long step, bool sec, bool file, bool absolute)
&& uhp->uh_alt_next.ptr->uh_walk != nomark && uhp->uh_alt_next.ptr->uh_walk != nomark
&& uhp->uh_alt_next.ptr->uh_walk != mark) { && uhp->uh_alt_next.ptr->uh_walk != mark) {
uhp = uhp->uh_alt_next.ptr; uhp = uhp->uh_alt_next.ptr;
} } else if (uhp->uh_next.ptr != NULL && uhp->uh_alt_prev.ptr == NULL
/* go up in the tree if we haven't been there and we are at the // go up in the tree if we haven't been there and we are at the
* start of alternate branches */ // start of alternate branches
else if (uhp->uh_next.ptr != NULL && uhp->uh_alt_prev.ptr == NULL && uhp->uh_next.ptr->uh_walk != nomark
&& uhp->uh_next.ptr->uh_walk != nomark && uhp->uh_next.ptr->uh_walk != mark) {
&& uhp->uh_next.ptr->uh_walk != mark) {
// If still at the start we don't go through this change. // If still at the start we don't go through this change.
if (uhp == curbuf->b_u_curhead) { if (uhp == curbuf->b_u_curhead) {
uhp->uh_walk = nomark; uhp->uh_walk = nomark;
@ -2297,8 +2296,8 @@ static void u_undoredo(int undo, bool do_buf_event)
bool empty_buffer; // buffer became empty bool empty_buffer; // buffer became empty
u_header_T *curhead = curbuf->b_u_curhead; u_header_T *curhead = curbuf->b_u_curhead;
/* Don't want autocommands using the undo structures here, they are // Don't want autocommands using the undo structures here, they are
* invalid till the end. */ // invalid till the end.
block_autocmds(); block_autocmds();
#ifdef U_DEBUG #ifdef U_DEBUG
@ -2549,8 +2548,8 @@ static void u_undoredo(int undo, bool do_buf_event)
} }
} }
/* The timestamp can be the same for multiple changes, just use the one of // The timestamp can be the same for multiple changes, just use the one of
* the undone/redone change. */ // the undone/redone change.
curbuf->b_u_time_cur = curhead->uh_time; curbuf->b_u_time_cur = curhead->uh_time;
unblock_autocmds(); unblock_autocmds();
@ -2709,12 +2708,11 @@ void ex_undolist(exarg_T *eap)
&& uhp->uh_alt_next.ptr->uh_walk != nomark && uhp->uh_alt_next.ptr->uh_walk != nomark
&& uhp->uh_alt_next.ptr->uh_walk != mark) { && uhp->uh_alt_next.ptr->uh_walk != mark) {
uhp = uhp->uh_alt_next.ptr; uhp = uhp->uh_alt_next.ptr;
} } else if (uhp->uh_next.ptr != NULL && uhp->uh_alt_prev.ptr == NULL
/* go up in the tree if we haven't been there and we are at the // go up in the tree if we haven't been there and we are at the
* start of alternate branches */ // start of alternate branches
else if (uhp->uh_next.ptr != NULL && uhp->uh_alt_prev.ptr == NULL && uhp->uh_next.ptr->uh_walk != nomark
&& uhp->uh_next.ptr->uh_walk != nomark && uhp->uh_next.ptr->uh_walk != mark) {
&& uhp->uh_next.ptr->uh_walk != mark) {
uhp = uhp->uh_next.ptr; uhp = uhp->uh_next.ptr;
--changes; --changes;
} else { } else {
@ -2906,8 +2904,8 @@ static void u_freeheader(buf_T *buf, u_header_T *uhp, u_header_T **uhpp)
{ {
u_header_T *uhap; u_header_T *uhap;
/* When there is an alternate redo list free that branch completely, // When there is an alternate redo list free that branch completely,
* because we can never go there. */ // because we can never go there.
if (uhp->uh_alt_next.ptr != NULL) { if (uhp->uh_alt_next.ptr != NULL) {
u_freebranch(buf, uhp->uh_alt_next.ptr, uhpp); u_freebranch(buf, uhp->uh_alt_next.ptr, uhpp);
} }
@ -2942,8 +2940,8 @@ static void u_freebranch(buf_T *buf, u_header_T *uhp, u_header_T **uhpp)
{ {
u_header_T *tofree, *next; u_header_T *tofree, *next;
/* If this is the top branch we may need to use u_freeheader() to update // If this is the top branch we may need to use u_freeheader() to update
* all the pointers. */ // all the pointers.
if (uhp == buf->b_u_oldhead) { if (uhp == buf->b_u_oldhead) {
while (buf->b_u_oldhead != NULL) { while (buf->b_u_oldhead != NULL) {
u_freeheader(buf, buf->b_u_oldhead, uhpp); u_freeheader(buf, buf->b_u_oldhead, uhpp);

View File

@ -298,8 +298,8 @@ newwindow:
tabpage_T *oldtab = curtab; tabpage_T *oldtab = curtab;
tabpage_T *newtab; tabpage_T *newtab;
/* First create a new tab with the window, then go back to // First create a new tab with the window, then go back to
* the old tab and close the window there. */ // the old tab and close the window there.
wp = curwin; wp = curwin;
if (win_new_tabpage((int)Prenum, NULL) == OK if (win_new_tabpage((int)Prenum, NULL) == OK
&& valid_tabpage(oldtab)) { && valid_tabpage(oldtab)) {
@ -519,8 +519,8 @@ wingotofile:
postponed_split = -1; postponed_split = -1;
} }
/* Execute the command right here, required when // Execute the command right here, required when
* "wincmd g}" was used in a function. */ // "wincmd g}" was used in a function.
do_nv_ident('g', xchar); do_nv_ident('g', xchar);
break; break;
@ -922,8 +922,8 @@ int win_split(int size, int flags)
return FAIL; return FAIL;
} }
/* When creating the help window make a snapshot of the window layout. // When creating the help window make a snapshot of the window layout.
* Otherwise clear the snapshot, it's now invalid. */ // Otherwise clear the snapshot, it's now invalid.
if (flags & WSP_HELP) { if (flags & WSP_HELP) {
make_snapshot(SNAP_HELP_IDX); make_snapshot(SNAP_HELP_IDX);
} else { } else {
@ -1260,8 +1260,8 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
frame_append(curfrp, frp); frame_append(curfrp, frp);
} }
/* Set w_fraction now so that the cursor keeps the same relative // Set w_fraction now so that the cursor keeps the same relative
* vertical position. */ // vertical position.
if (!did_set_fraction) { if (!did_set_fraction) {
set_fraction(oldwin); set_fraction(oldwin);
} }
@ -1287,8 +1287,8 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
} }
frp->fr_height = curfrp->fr_height; frp->fr_height = curfrp->fr_height;
/* "new_size" of the current window goes to the new window, use // "new_size" of the current window goes to the new window, use
* one column for the vertical separator */ // one column for the vertical separator
win_new_width(wp, new_size); win_new_width(wp, new_size);
if (before) { if (before) {
wp->w_vsep_width = 1; wp->w_vsep_width = 1;
@ -1328,8 +1328,8 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
} }
frp->fr_width = curfrp->fr_width; frp->fr_width = curfrp->fr_width;
/* "new_size" of the current window goes to the new window, use // "new_size" of the current window goes to the new window, use
* one row for the status line */ // one row for the status line
win_new_height(wp, new_size); win_new_height(wp, new_size);
if (flags & (WSP_TOP | WSP_BOT)) { if (flags & (WSP_TOP | WSP_BOT)) {
int new_fr_height = curfrp->fr_height - new_size; int new_fr_height = curfrp->fr_height - new_size;
@ -1388,8 +1388,8 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
'v'); 'v');
} }
/* Don't change the window height/width to 'winheight' / 'winwidth' if a // Don't change the window height/width to 'winheight' / 'winwidth' if a
* size was given. */ // size was given.
if (flags & WSP_VERT) { if (flags & WSP_VERT) {
i = p_wiw; i = p_wiw;
if (size != 0) { if (size != 0) {
@ -1589,8 +1589,8 @@ int make_windows(int count, bool vertical)
int todo; int todo;
if (vertical) { if (vertical) {
/* Each windows needs at least 'winminwidth' lines and a separator // Each windows needs at least 'winminwidth' lines and a separator
* column. */ // column.
maxcount = (curwin->w_width + curwin->w_vsep_width maxcount = (curwin->w_width + curwin->w_vsep_width
- (p_wiw - p_wmw)) / (p_wmw + 1); - (p_wiw - p_wmw)) / (p_wmw + 1);
} else { } else {
@ -1679,8 +1679,8 @@ static void win_exchange(long Prenum)
frp = curwin->w_frame->fr_prev; frp = curwin->w_frame->fr_prev;
} }
/* We can only exchange a window with another window, not with a frame // We can only exchange a window with another window, not with a frame
* containing windows. */ // containing windows.
if (frp == NULL || frp->fr_win == NULL || frp->fr_win == curwin) { if (frp == NULL || frp->fr_win == NULL || frp->fr_win == curwin) {
return; return;
} }
@ -1890,8 +1890,8 @@ void win_move_after(win_T *win1, win_T *win2)
win1->w_status_height = win2->w_status_height; win1->w_status_height = win2->w_status_height;
win2->w_status_height = height; win2->w_status_height = height;
if (win1->w_vsep_width == 1) { if (win1->w_vsep_width == 1) {
/* Remove the vertical separator from win1, add it to the last // Remove the vertical separator from win1, add it to the last
* window, win2. Adjust the frame widths. */ // window, win2. Adjust the frame widths.
win2->w_vsep_width = 1; win2->w_vsep_width = 1;
win2->w_frame->fr_width += 1; win2->w_frame->fr_width += 1;
win1->w_vsep_width = 0; win1->w_vsep_width = 0;
@ -1955,8 +1955,8 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
bool hnc; bool hnc;
if (topfr->fr_layout == FR_LEAF) { if (topfr->fr_layout == FR_LEAF) {
/* Set the width/height of this frame. // Set the width/height of this frame.
* Redraw when size or position changes */ // Redraw when size or position changes
if (topfr->fr_height != height || topfr->fr_win->w_winrow != row if (topfr->fr_height != height || topfr->fr_win->w_winrow != row
|| topfr->fr_width != width || || topfr->fr_width != width ||
topfr->fr_win->w_wincol != col) { topfr->fr_win->w_wincol != col) {
@ -2028,8 +2028,8 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
} else if (totwincount > 1 } else if (totwincount > 1
&& (room + (totwincount - 2)) && (room + (totwincount - 2))
/ (totwincount - 1) > p_wiw) { / (totwincount - 1) > p_wiw) {
/* Can make all windows wider than 'winwidth', spread // Can make all windows wider than 'winwidth', spread
* the room equally. */ // the room equally.
next_curwin_size = (room + p_wiw next_curwin_size = (room + p_wiw
+ (totwincount - 1) * p_wmw + (totwincount - 1) * p_wmw
+ (totwincount - 1)) / totwincount; + (totwincount - 1)) / totwincount;
@ -2084,8 +2084,8 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
new_size += n; new_size += n;
} }
/* Skip frame that is full width when splitting or closing a // Skip frame that is full width when splitting or closing a
* window, unless equalizing all frames. */ // window, unless equalizing all frames.
if (!current || dir != 'v' || topfr->fr_parent != NULL if (!current || dir != 'v' || topfr->fr_parent != NULL
|| (new_size != fr->fr_width) || (new_size != fr->fr_width)
|| frame_has_win(fr, next_curwin)) { || frame_has_win(fr, next_curwin)) {
@ -2120,8 +2120,8 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
m = frame_minheight(topfr, next_curwin); m = frame_minheight(topfr, next_curwin);
room = height - m; room = height - m;
if (room < 0) { if (room < 0) {
/* The room is less then 'winheight', use all space for the // The room is less then 'winheight', use all space for the
* current window. */ // current window.
next_curwin_size = p_wh + room; next_curwin_size = p_wh + room;
room = 0; room = 0;
} else { } else {
@ -2159,8 +2159,8 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
} else if (totwincount > 1 } else if (totwincount > 1
&& (room + (totwincount - 2)) && (room + (totwincount - 2))
/ (totwincount - 1) > p_wh) { / (totwincount - 1) > p_wh) {
/* can make all windows higher than 'winheight', // can make all windows higher than 'winheight',
* spread the room equally. */ // spread the room equally.
next_curwin_size = (room + p_wh next_curwin_size = (room + p_wh
+ (totwincount - 1) * p_wmh + (totwincount - 1) * p_wmh
+ (totwincount - 1)) / totwincount; + (totwincount - 1)) / totwincount;
@ -2214,8 +2214,8 @@ static void win_equal_rec(win_T *next_curwin, bool current, frame_T *topfr, int
} }
new_size += n; new_size += n;
} }
/* Skip frame that is full width when splitting or closing a // Skip frame that is full width when splitting or closing a
* window, unless equalizing all frames. */ // window, unless equalizing all frames.
if (!current || dir != 'h' || topfr->fr_parent != NULL if (!current || dir != 'h' || topfr->fr_parent != NULL
|| (new_size != fr->fr_height) || (new_size != fr->fr_height)
|| frame_has_win(fr, next_curwin)) { || frame_has_win(fr, next_curwin)) {
@ -2263,8 +2263,8 @@ void close_windows(buf_T *buf, int keep_curwin)
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)) { && !(wp->w_closing || wp->w_buffer->b_locked > 0)) {
win_close_othertab(wp, false, tp); win_close_othertab(wp, false, tp);
/* Start all over, the tab page may be closed and // Start all over, the tab page may be closed and
* autocommands may change the window layout. */ // autocommands may change the window layout.
nexttp = first_tabpage; nexttp = first_tabpage;
break; break;
} }
@ -2630,8 +2630,8 @@ int win_close(win_T *win, bool free_buf)
*/ */
last_status(false); last_status(false);
/* After closing the help window, try restoring the window layout from // After closing the help window, try restoring the window layout from
* before it was opened. */ // before it was opened.
if (help_window) { if (help_window) {
restore_snapshot(SNAP_HELP_IDX, close_curwin); restore_snapshot(SNAP_HELP_IDX, close_curwin);
} }
@ -2703,8 +2703,8 @@ void win_close_othertab(win_T *win, int free_buf, tabpage_T *tp)
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, false); close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, false);
} }
/* Careful: Autocommands may have closed the tab page or made it the // Careful: Autocommands may have closed the tab page or made it the
* current tab page. */ // current tab page.
for (ptp = first_tabpage; ptp != NULL && ptp != tp; ptp = ptp->tp_next) { for (ptp = first_tabpage; ptp != NULL && ptp != tp; ptp = ptp->tp_next) {
; ;
} }
@ -2863,9 +2863,9 @@ win_T *winframe_remove(win_T *win, int *dirp, tabpage_T *tp)
frame_remove(frp_close); frame_remove(frp_close);
if (frp_close->fr_parent->fr_layout == FR_COL) { if (frp_close->fr_parent->fr_layout == FR_COL) {
/* When 'winfixheight' is set, try to find another frame in the column // When 'winfixheight' is set, try to find another frame in the column
* (as close to the closed frame as possible) to distribute the height // (as close to the closed frame as possible) to distribute the height
* to. */ // to.
if (frp2->fr_win != NULL && frp2->fr_win->w_p_wfh) { if (frp2->fr_win != NULL && frp2->fr_win->w_p_wfh) {
frp = frp_close->fr_prev; frp = frp_close->fr_prev;
frp3 = frp_close->fr_next; frp3 = frp_close->fr_next;
@ -2922,8 +2922,8 @@ win_T *winframe_remove(win_T *win, int *dirp, tabpage_T *tp)
*dirp = 'h'; *dirp = 'h';
} }
/* If rows/columns go to a window below/right its positions need to be // If rows/columns go to a window below/right its positions need to be
* updated. Can only be done after the sizes have been updated. */ // updated. Can only be done after the sizes have been updated.
if (frp2 == frp_close->fr_next) { if (frp2 == frp_close->fr_next) {
int row = win->w_winrow; int row = win->w_winrow;
int col = win->w_wincol; int col = win->w_wincol;
@ -2932,8 +2932,8 @@ win_T *winframe_remove(win_T *win, int *dirp, tabpage_T *tp)
} }
if (frp2->fr_next == NULL && frp2->fr_prev == NULL) { if (frp2->fr_next == NULL && frp2->fr_prev == NULL) {
/* There is no other frame in this list, move its info to the parent // There is no other frame in this list, move its info to the parent
* and remove it. */ // and remove it.
frp2->fr_parent->fr_layout = frp2->fr_layout; frp2->fr_parent->fr_layout = frp2->fr_layout;
frp2->fr_parent->fr_child = frp2->fr_child; frp2->fr_parent->fr_child = frp2->fr_child;
FOR_ALL_FRAMES(frp, frp2->fr_child) { FOR_ALL_FRAMES(frp, frp2->fr_child) {
@ -2951,8 +2951,8 @@ win_T *winframe_remove(win_T *win, int *dirp, tabpage_T *tp)
frp2 = frp->fr_parent; frp2 = frp->fr_parent;
if (frp2 != NULL && frp2->fr_layout == frp->fr_layout) { if (frp2 != NULL && frp2->fr_layout == frp->fr_layout) {
/* The frame above the parent has the same layout, have to merge // The frame above the parent has the same layout, have to merge
* the frames into this list. */ // the frames into this list.
if (frp2->fr_child == frp) { if (frp2->fr_child == frp) {
frp2->fr_child = frp->fr_child; frp2->fr_child = frp->fr_child;
} }
@ -3641,8 +3641,8 @@ static int win_alloc_firstwin(win_T *oldwin)
{ {
curwin = win_alloc(NULL, false); curwin = win_alloc(NULL, false);
if (oldwin == NULL) { if (oldwin == NULL) {
/* Very first window, need to create an empty buffer for it and // Very first window, need to create an empty buffer for it and
* initialize from scratch. */ // initialize from scratch.
curbuf = buflist_new(NULL, NULL, 1L, BLN_LISTED); curbuf = buflist_new(NULL, NULL, 1L, BLN_LISTED);
if (curbuf == NULL) { if (curbuf == NULL) {
return FAIL; return FAIL;
@ -4014,10 +4014,10 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, bool trigger_enter_a
const int row = win_comp_pos(); // recompute w_winrow for all windows const int row = win_comp_pos(); // recompute w_winrow for all windows
diff_need_scrollbind = true; diff_need_scrollbind = true;
/* The tabpage line may have appeared or disappeared, may need to resize // The tabpage line may have appeared or disappeared, may need to resize
* the frames for that. When the Vim window was resized need to update // the frames for that. When the Vim window was resized need to update
* frame sizes too. Use the stored value of p_ch, so that it can be // frame sizes too. Use the stored value of p_ch, so that it can be
* different for each tab page. */ // different for each tab page.
if (p_ch != curtab->tp_ch_used) { if (p_ch != curtab->tp_ch_used) {
clear_cmdline = true; clear_cmdline = true;
} }
@ -4112,8 +4112,8 @@ void goto_tabpage(int n)
tp = curtab->tp_next; tp = curtab->tp_next;
} }
} else if (n < 0) { } else if (n < 0) {
/* "gT": go to previous tab page, wrap around end. "N gT" repeats // "gT": go to previous tab page, wrap around end. "N gT" repeats
* this N times. */ // this N times.
ttp = curtab; ttp = curtab;
for (i = n; i < 0; ++i) { for (i = n; i < 0; ++i) {
for (tp = first_tabpage; tp->tp_next != ttp && tp->tp_next != NULL; for (tp = first_tabpage; tp->tp_next != ttp && tp->tp_next != NULL;
@ -4677,9 +4677,9 @@ static win_T *win_alloc(win_T *after, bool hidden)
new_wp->w_vars = tv_dict_alloc(); new_wp->w_vars = tv_dict_alloc();
init_var_dict(new_wp->w_vars, &new_wp->w_winvar, VAR_SCOPE); init_var_dict(new_wp->w_vars, &new_wp->w_winvar, VAR_SCOPE);
/* Don't execute autocommands while the window is not properly // Don't execute autocommands while the window is not properly
* initialized yet. gui_create_scrollbar() may trigger a FocusGained // initialized yet. gui_create_scrollbar() may trigger a FocusGained
* event. */ // event.
block_autocmds(); block_autocmds();
/* /*
* link the window in the window list * link the window in the window list
@ -4742,8 +4742,8 @@ static void win_free(win_T *wp, tabpage_T *tp)
// reduce the reference count to the argument list. // reduce the reference count to the argument list.
alist_unlink(wp->w_alist); alist_unlink(wp->w_alist);
/* Don't execute autocommands while the window is halfway being deleted. // Don't execute autocommands while the window is halfway being deleted.
* gui_mch_destroy_scrollbar() may trigger a FocusGained event. */ // gui_mch_destroy_scrollbar() may trigger a FocusGained event.
block_autocmds(); block_autocmds();
clear_winopt(&wp->w_onebuf_opt); clear_winopt(&wp->w_onebuf_opt);
@ -5200,8 +5200,8 @@ static void frame_setheight(frame_T *curfrp, int height)
frame_new_height(curfrp, height, false, false); frame_new_height(curfrp, height, false, false);
} }
} else if (curfrp->fr_parent->fr_layout == FR_ROW) { } else if (curfrp->fr_parent->fr_layout == FR_ROW) {
/* Row of frames: Also need to resize frames left and right of this // Row of frames: Also need to resize frames left and right of this
* one. First check for the minimal height of these. */ // one. First check for the minimal height of these.
h = frame_minheight(curfrp->fr_parent, NULL); h = frame_minheight(curfrp->fr_parent, NULL);
if (height < h) { if (height < h) {
height = h; height = h;
@ -5261,13 +5261,13 @@ static void frame_setheight(frame_T *curfrp, int height)
*/ */
take = height - curfrp->fr_height; take = height - curfrp->fr_height;
/* If there is not enough room, also reduce the height of a window // If there is not enough room, also reduce the height of a window
* with 'winfixheight' set. */ // with 'winfixheight' set.
if (height > room + room_cmdline - room_reserved) { if (height > room + room_cmdline - room_reserved) {
room_reserved = room + room_cmdline - height; room_reserved = room + room_cmdline - height;
} }
/* If there is only a 'winfixheight' window and making the // If there is only a 'winfixheight' window and making the
* window smaller, need to make the other window taller. */ // window smaller, need to make the other window taller.
if (take < 0 && room - curfrp->fr_height < room_reserved) { if (take < 0 && room - curfrp->fr_height < room_reserved) {
room_reserved = 0; room_reserved = 0;
} }
@ -5342,8 +5342,8 @@ void win_setwidth(int width)
void win_setwidth_win(int width, win_T *wp) void win_setwidth_win(int width, win_T *wp)
{ {
/* Always keep current window at least one column wide, even when // Always keep current window at least one column wide, even when
* 'winminwidth' is zero. */ // 'winminwidth' is zero.
if (wp == curwin) { if (wp == curwin) {
if (width < p_wmw) { if (width < p_wmw) {
width = p_wmw; width = p_wmw;
@ -5394,8 +5394,8 @@ static void frame_setwidth(frame_T *curfrp, int width)
} }
if (curfrp->fr_parent->fr_layout == FR_COL) { if (curfrp->fr_parent->fr_layout == FR_COL) {
/* Column of frames: Also need to resize frames above and below of // Column of frames: Also need to resize frames above and below of
* this one. First check for the minimal width of these. */ // this one. First check for the minimal width of these.
w = frame_minwidth(curfrp->fr_parent, NULL); w = frame_minwidth(curfrp->fr_parent, NULL);
if (width < w) { if (width < w) {
width = w; width = w;
@ -5442,13 +5442,13 @@ static void frame_setwidth(frame_T *curfrp, int width)
*/ */
take = width - curfrp->fr_width; take = width - curfrp->fr_width;
/* If there is not enough room, also reduce the width of a window // If there is not enough room, also reduce the width of a window
* with 'winfixwidth' set. */ // with 'winfixwidth' set.
if (width > room - room_reserved) { if (width > room - room_reserved) {
room_reserved = room - width; room_reserved = room - width;
} }
/* If there is only a 'winfixwidth' window and making the // If there is only a 'winfixwidth' window and making the
* window smaller, need to make the other window narrower. */ // window smaller, need to make the other window narrower.
if (take < 0 && room - curfrp->fr_width < room_reserved) { if (take < 0 && room - curfrp->fr_width < room_reserved) {
room_reserved = 0; room_reserved = 0;
} }
@ -5557,8 +5557,8 @@ void win_drag_status_line(win_T *dragwin, int offset)
curfr = fr; curfr = fr;
if (fr != topframe) { // more than one window if (fr != topframe) { // more than one window
fr = fr->fr_parent; fr = fr->fr_parent;
/* When the parent frame is not a column of frames, its parent should // When the parent frame is not a column of frames, its parent should
* be. */ // be.
if (fr->fr_layout != FR_COL) { if (fr->fr_layout != FR_COL) {
curfr = fr; curfr = fr;
if (fr != topframe) { // only a row of windows, may drag statusline if (fr != topframe) { // only a row of windows, may drag statusline
@ -6009,9 +6009,9 @@ void command_height(void)
frame_T *frp; frame_T *frp;
int old_p_ch = curtab->tp_ch_used; int old_p_ch = curtab->tp_ch_used;
/* Use the value of p_ch that we remembered. This is needed for when the // Use the value of p_ch that we remembered. This is needed for when the
* GUI starts up, we can't be sure in what order things happen. And when // GUI starts up, we can't be sure in what order things happen. And when
* p_ch was changed in another tab page. */ // p_ch was changed in another tab page.
curtab->tp_ch_used = p_ch; curtab->tp_ch_used = p_ch;
// Find bottom frame with width of screen. // Find bottom frame with width of screen.
@ -6270,8 +6270,8 @@ static void last_status_rec(frame_T *fr, bool statusline)
EMSG(_(e_noroom)); EMSG(_(e_noroom));
return; return;
} }
/* In a column of frames: go to frame above. If already at // In a column of frames: go to frame above. If already at
* the top or in a row of frames: go to parent. */ // the top or in a row of frames: go to parent.
if (fp->fr_parent->fr_layout == FR_COL && fp->fr_prev != NULL) { if (fp->fr_parent->fr_layout == FR_COL && fp->fr_prev != NULL) {
fp = fp->fr_prev; fp = fp->fr_prev;
} else { } else {