Convert some values from buffer_defs.h to bools

This commit is contained in:
Wayne Rowcliffe 2014-10-25 11:23:08 -05:00
parent 8da78bc3ae
commit 63e2558870
17 changed files with 124 additions and 124 deletions

View File

@ -332,7 +332,7 @@ close_buffer (
/* When the buffer is no longer in a window, trigger BufWinLeave */
if (buf->b_nwindows == 1) {
buf->b_closing = TRUE;
buf->b_closing = true;
apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname,
FALSE, buf);
if (!buf_valid(buf)) {
@ -340,7 +340,7 @@ close_buffer (
EMSG(_(e_auabort));
return;
}
buf->b_closing = FALSE;
buf->b_closing = false;
if (abort_if_last && one_window()) {
/* Autocommands made this the only window. */
EMSG(_(e_auabort));
@ -350,7 +350,7 @@ close_buffer (
/* When the buffer becomes hidden, but is not unloaded, trigger
* BufHidden */
if (!unload_buf) {
buf->b_closing = TRUE;
buf->b_closing = true;
apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname,
FALSE, buf);
if (!buf_valid(buf)) {
@ -358,7 +358,7 @@ close_buffer (
EMSG(_(e_auabort));
return;
}
buf->b_closing = FALSE;
buf->b_closing = false;
if (abort_if_last && one_window()) {
/* Autocommands made this the only window. */
EMSG(_(e_auabort));
@ -447,7 +447,7 @@ close_buffer (
buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED;
/* Init the options when loaded again. */
buf->b_p_initialized = FALSE;
buf->b_p_initialized = false;
}
buf_clear_file(buf);
if (del_buf)
@ -481,7 +481,7 @@ void buf_freeall(buf_T *buf, int flags)
{
bool is_curbuf = (buf == curbuf);
buf->b_closing = TRUE;
buf->b_closing = true;
apply_autocmds(EVENT_BUFUNLOAD, buf->b_fname, buf->b_fname, FALSE, buf);
if (!buf_valid(buf)) /* autocommands may delete the buffer */
return;
@ -496,7 +496,7 @@ void buf_freeall(buf_T *buf, int flags)
if (!buf_valid(buf)) /* autocommands may delete the buffer */
return;
}
buf->b_closing = FALSE;
buf->b_closing = false;
if (aborting()) /* autocmds may abort script processing */
return;
@ -1398,7 +1398,7 @@ buflist_new (
free_buffer_stuff(buf, FALSE); /* delete local variables et al. */
/* Init the options. */
buf->b_p_initialized = FALSE;
buf->b_p_initialized = false;
buf_copy_options(buf, BCO_ENTER);
/* need to reload lmaps and set b:keymap_name */
@ -1446,7 +1446,7 @@ buflist_new (
buf->file_id_valid = true;
buf->file_id = file_id;
}
buf->b_u_synced = TRUE;
buf->b_u_synced = true;
buf->b_flags = BF_CHECK_RO | BF_NEVERLOADED;
if (flags & BLN_DUMMY)
buf->b_flags |= BF_DUMMY;
@ -2004,7 +2004,7 @@ static void buflist_setfpos(buf_T *buf, win_T *win, linenr_T lnum, colnr_T col,
copy_winopt(&win->w_onebuf_opt, &wip->wi_opt);
wip->wi_fold_manual = win->w_fold_manual;
cloneFoldGrowArray(&win->w_folds, &wip->wi_folds);
wip->wi_optset = TRUE;
wip->wi_optset = true;
}
/* insert the entry in front of the list */
@ -2084,7 +2084,7 @@ void get_winopts(buf_T *buf)
if (wip != NULL && wip->wi_optset) {
copy_winopt(&wip->wi_opt, &curwin->w_onebuf_opt);
curwin->w_fold_manual = wip->wi_fold_manual;
curwin->w_foldinvalid = TRUE;
curwin->w_foldinvalid = true;
cloneFoldGrowArray(&wip->wi_folds, &curwin->w_folds);
} else
copy_winopt(&curwin->w_allbuf_opt, &curwin->w_onebuf_opt);

View File

@ -243,9 +243,9 @@ struct wininfo_S {
wininfo_T *wi_prev; /* previous entry or NULL for first entry */
win_T *wi_win; /* pointer to window that did set wi_fpos */
pos_T wi_fpos; /* last cursor position in the file */
int wi_optset; /* TRUE when wi_opt has useful values */
bool wi_optset; /* true when wi_opt has useful values */
winopt_T wi_opt; /* local window options */
int wi_fold_manual; /* copy of w_fold_manual */
bool wi_fold_manual; /* copy of w_fold_manual */
garray_T wi_folds; /* clone of w_folds */
};
@ -464,7 +464,7 @@ struct file_buffer {
int b_nwindows; /* nr of windows open on this buffer */
int b_flags; /* various BF_ flags */
int b_closing; /* buffer is being closed, don't let
bool b_closing; /* buffer is being closed, don't let
autocommands close it too. */
/*
@ -482,18 +482,18 @@ struct file_buffer {
int b_fnum; /* buffer number for this file. */
int b_changed; /* 'modified': Set to TRUE if something in the
bool b_changed; /* 'modified': Set to true if something in the
file has been changed and not written out. */
int b_changedtick; /* incremented for each change, also for undo */
int b_saving; /* Set to TRUE if we are in the middle of
bool b_saving; /* Set to true if we are in the middle of
saving the buffer. */
/*
* Changes to a buffer require updating of the display. To minimize the
* work, remember changes made and update everything at once.
*/
int b_mod_set; /* TRUE when there are changes since the last
bool b_mod_set; /* true when there are changes since the last
time the display was updated */
linenr_T b_mod_top; /* topmost lnum that was changed */
linenr_T b_mod_bot; /* lnum below last changed line, AFTER the
@ -524,7 +524,7 @@ struct file_buffer {
*/
pos_T b_changelist[JUMPLISTSIZE];
int b_changelistlen; /* number of active entries */
int b_new_change; /* set by u_savecommon() */
bool b_new_change; /* set by u_savecommon() */
/*
* Character table, only used in charset.c for 'iskeyword'
@ -546,7 +546,7 @@ struct file_buffer {
pos_T b_op_start_orig; // used for Insstart_orig
pos_T b_op_end;
int b_marks_read; /* Have we read viminfo marks yet? */
bool b_marks_read; /* Have we read viminfo marks yet? */
/*
* The following only used in undo.c.
@ -556,7 +556,7 @@ struct file_buffer {
if b_u_curhead is not NULL */
u_header_T *b_u_curhead; /* pointer to current header */
int b_u_numhead; /* current number of headers */
int b_u_synced; /* entry lists are synced */
bool b_u_synced; /* entry lists are synced */
long b_u_seq_last; /* last used undo sequence number */
long b_u_save_nr_last; /* counter for last file write */
long b_u_seq_cur; /* hu_seq of header below which we are now */
@ -570,7 +570,7 @@ struct file_buffer {
linenr_T b_u_line_lnum; /* line number of line in u_line */
colnr_T b_u_line_colnr; /* optional column number */
int b_scanned; /* ^N/^P have scanned this buffer */
bool b_scanned; /* ^N/^P have scanned this buffer */
/* flags for use of ":lmap" and IM control */
long b_p_iminsert; /* input mode for insert */
@ -595,7 +595,7 @@ struct file_buffer {
* They are here because their value depends on the type of file
* or contents of the file being edited.
*/
int b_p_initialized; /* set when options initialized */
bool b_p_initialized; /* set when options initialized */
int b_p_scriptID[BV_COUNT]; /* SIDs for buffer-local options */
@ -731,8 +731,8 @@ struct file_buffer {
* then set to indicate that a swap file may be opened later. It is reset
* if a swap file could not be opened.
*/
int b_may_swap;
int b_did_warn; /* Set to 1 if user has been warned on first
bool b_may_swap;
bool b_did_warn; /* Set to true if user has been warned on first
change of a read-only file */
/* Two special kinds of buffers:
@ -740,7 +740,7 @@ struct file_buffer {
* spell buffer - used for spell info, never displayed and doesn't have a
* file name.
*/
int b_help; /* TRUE for help file buffer (when set b_p_bt
bool b_help; /* TRUE for help file buffer (when set b_p_bt
is "help") */
bool b_spell; /* True for a spell file buffer, most fields
are not used! Use the B_SPELL macro to
@ -925,7 +925,7 @@ struct window_S {
win_T *w_prev; /* link to previous window */
win_T *w_next; /* link to next window */
int w_closing; /* window is being closed, don't let
bool w_closing; /* window is being closed, don't let
autocommands close it too. */
frame_T *w_frame; /* frame containing this window */
@ -961,9 +961,9 @@ struct window_S {
e.g. by winrestview() */
int w_topfill; /* number of filler lines above w_topline */
int w_old_topfill; /* w_topfill at last redraw */
int w_botfill; /* TRUE when filler lines are actually
bool w_botfill; /* true when filler lines are actually
below w_topline (at end of file) */
int w_old_botfill; /* w_botfill at last redraw */
bool w_old_botfill; /* w_botfill at last redraw */
colnr_T w_leftcol; /* window column number of the left most
character in the window; used when
'wrap' is off */
@ -1039,9 +1039,9 @@ struct window_S {
wline_T *w_lines;
garray_T w_folds; /* array of nested folds */
char w_fold_manual; /* when TRUE: some folds are opened/closed
bool w_fold_manual; /* when true: some folds are opened/closed
manually */
char w_foldinvalid; /* when TRUE: folding needs to be
bool w_foldinvalid; /* when true: folding needs to be
recomputed */
int w_nrwidth; /* width of 'number' and 'relativenumber'
column being used */

View File

@ -1745,11 +1745,11 @@ void diff_set_topline(win_T *fromwin, win_T *towin)
}
// safety check (if diff info gets outdated strange things may happen)
towin->w_botfill = FALSE;
towin->w_botfill = false;
if (towin->w_topline > towin->w_buffer->b_ml.ml_line_count) {
towin->w_topline = towin->w_buffer->b_ml.ml_line_count;
towin->w_botfill = TRUE;
towin->w_botfill = true;
}
if (towin->w_topline < 1) {

View File

@ -3438,7 +3438,7 @@ static int ins_compl_get_exp(pos_T *ini)
if (!compl_started) {
FOR_ALL_BUFFERS(buf) {
buf->b_scanned = 0;
buf->b_scanned = false;
}
found_all = FALSE;
ins_buf = curbuf;
@ -3764,7 +3764,7 @@ static int ins_compl_get_exp(pos_T *ini)
/* Mark a buffer scanned when it has been scanned completely */
if (type == 0 || type == CTRL_X_PATH_PATTERNS) {
assert(ins_buf);
ins_buf->b_scanned = TRUE;
ins_buf->b_scanned = true;
}
compl_started = FALSE;

View File

@ -2830,7 +2830,7 @@ do_ecmd (
if ((flags & ECMD_SET_HELP) || keep_help_flag) {
char_u *p;
curbuf->b_help = TRUE;
curbuf->b_help = true;
set_string_option_direct((char_u *)"buftype", -1,
(char_u *)"help", OPT_FREE|OPT_LOCAL, 0);

View File

@ -2197,7 +2197,7 @@ static void check_marks_read(void)
/* Always set b_marks_read; needed when 'viminfo' is changed to include
* the ' parameter after opening a buffer. */
curbuf->b_marks_read = TRUE;
curbuf->b_marks_read = true;
}
#ifdef UNIX
@ -2690,7 +2690,7 @@ buf_write (
got_int = FALSE;
/* Mark the buffer as 'being saved' to prevent changed buffer warnings */
buf->b_saving = TRUE;
buf->b_saving = true;
/*
* If we are not appending or filtering, the file exists, and the
@ -3665,7 +3665,7 @@ fail:
nofail:
/* Done saving, we accept changed buffer warnings again */
buf->b_saving = FALSE;
buf->b_saving = false;
free(backup);
if (buffer != smallbuf)
@ -6489,7 +6489,7 @@ apply_autocmds_group (
{
char_u *sfname = NULL; /* short file name */
char_u *tail;
int save_changed;
bool save_changed;
buf_T *old_curbuf;
int retval = FALSE;
char_u *save_sourcing_name;

View File

@ -485,7 +485,7 @@ static void newFoldLevelWin(win_T *wp)
fp = (fold_T *)wp->w_folds.ga_data;
for (int i = 0; i < wp->w_folds.ga_len; ++i)
fp[i].fd_flags = FD_LEVEL;
wp->w_fold_manual = FALSE;
wp->w_fold_manual = false;
}
changed_window_setting_win(wp);
}
@ -648,7 +648,7 @@ void foldCreate(linenr_T start, linenr_T end)
if (use_level && !closed && level < curwin->w_p_fdl)
closeFold(start, 1L);
if (!use_level)
curwin->w_fold_manual = TRUE;
curwin->w_fold_manual = true;
fp->fd_flags = FD_CLOSED;
fp->fd_small = MAYBE;
@ -755,7 +755,7 @@ deleteFold (
void clearFolding(win_T *win)
{
deleteFoldRecurse(&win->w_folds);
win->w_foldinvalid = FALSE;
win->w_foldinvalid = false;
}
/* foldUpdate() {{{2 */
@ -800,7 +800,7 @@ void foldUpdate(win_T *wp, linenr_T top, linenr_T bot)
*/
void foldUpdateAll(win_T *win)
{
win->w_foldinvalid = TRUE;
win->w_foldinvalid = true;
redraw_win_later(win, NOT_VALID);
}
@ -1098,7 +1098,7 @@ static void checkupdate(win_T *wp)
{
if (wp->w_foldinvalid) {
foldUpdate(wp, (linenr_T)1, (linenr_T)MAXLNUM); /* will update all */
wp->w_foldinvalid = FALSE;
wp->w_foldinvalid = false;
}
}
@ -1251,7 +1251,7 @@ setManualFoldWin (
found->fd_flags = FD_CLOSED;
done |= DONE_ACTION;
}
wp->w_fold_manual = TRUE;
wp->w_fold_manual = true;
if (done & DONE_ACTION)
changed_window_setting_win(wp);
done |= DONE_FOLD;
@ -1877,7 +1877,7 @@ static void foldUpdateIEMS(win_T *wp, linenr_T top, linenr_T bot)
/* Need to update all folds. */
top = 1;
bot = wp->w_buffer->b_ml.ml_line_count;
wp->w_foldinvalid = FALSE;
wp->w_foldinvalid = false;
/* Mark all folds a maybe-small. */
setSmallMaybe(&wp->w_folds);
@ -2285,12 +2285,12 @@ static linenr_T foldUpdateIEMSRecurse(garray_T *gap, int level,
* The new fold is closed if the fold above it is closed.
* The first fold depends on the containing fold. */
if (topflags == FD_OPEN) {
flp->wp->w_fold_manual = TRUE;
flp->wp->w_fold_manual = true;
fp->fd_flags = FD_OPEN;
} else if (i <= 0) {
fp->fd_flags = topflags;
if (topflags != FD_LEVEL)
flp->wp->w_fold_manual = TRUE;
flp->wp->w_fold_manual = true;
} else
fp->fd_flags = (fp - 1)->fd_flags;
fp->fd_small = MAYBE;

View File

@ -277,9 +277,9 @@ int ml_open(buf_T *buf)
* When 'updatecount' is non-zero swap file may be opened later.
*/
if (p_uc && buf->b_p_swf)
buf->b_may_swap = TRUE;
buf->b_may_swap = true;
else
buf->b_may_swap = FALSE;
buf->b_may_swap = false;
/*
* Open the memfile. No swap file is created yet.
@ -495,7 +495,7 @@ void ml_open_file(buf_T *buf)
fname = vim_tempname();
if (fname != NULL)
(void)mf_open_file(mfp, fname); /* consumes fname! */
buf->b_may_swap = FALSE;
buf->b_may_swap = false;
return;
}
@ -540,7 +540,7 @@ void ml_open_file(buf_T *buf)
}
/* don't try to open a swap file again */
buf->b_may_swap = FALSE;
buf->b_may_swap = false;
}
/*

View File

@ -1855,7 +1855,7 @@ void changed(void)
*/
void changed_int(void)
{
curbuf->b_changed = TRUE;
curbuf->b_changed = true;
ml_setflags(curbuf);
check_status(curbuf);
redraw_tabline = TRUE;
@ -1900,7 +1900,7 @@ static void changedOneline(buf_T *buf, linenr_T lnum)
buf->b_mod_bot = lnum + 1;
} else {
/* set the area that must be redisplayed to one line */
buf->b_mod_set = TRUE;
buf->b_mod_set = true;
buf->b_mod_top = lnum;
buf->b_mod_bot = lnum + 1;
buf->b_mod_xlines = 0;
@ -2013,7 +2013,7 @@ changed_lines_buf (
buf->b_mod_xlines += xtra;
} else {
/* set the area that must be redisplayed */
buf->b_mod_set = TRUE;
buf->b_mod_set = true;
buf->b_mod_top = lnum;
buf->b_mod_bot = lnume + xtra;
buf->b_mod_xlines = xtra;
@ -2063,7 +2063,7 @@ static void changed_common(linenr_T lnum, colnr_T col, linenr_T lnume, long xtra
/* This is the first of a new sequence of undo-able changes
* and it's at some distance of the last change. Use a new
* position in the changelist. */
curbuf->b_new_change = FALSE;
curbuf->b_new_change = false;
if (curbuf->b_changelistlen == JUMPLISTSIZE) {
/* changelist is full: remove oldest entry */
@ -2195,7 +2195,7 @@ unchanged (
)
{
if (buf->b_changed || (ff && file_ff_differs(buf, FALSE))) {
buf->b_changed = 0;
buf->b_changed = false;
ml_setflags(buf);
if (ff)
save_file_ff(buf);
@ -2226,8 +2226,8 @@ void check_status(buf_T *buf)
* If the file is readonly, give a warning message with the first change.
* Don't do this for autocommands.
* Don't use emsg(), because it flushes the macro buffer.
* If we have undone all changes b_changed will be FALSE, but "b_did_warn"
* will be TRUE.
* If we have undone all changes b_changed will be false, but "b_did_warn"
* will be true.
* Careful: may trigger autocommands that reload the buffer.
*/
void
@ -2238,7 +2238,7 @@ change_warning (
{
static char *w_readonly = N_("W10: Warning: Changing a readonly file");
if (curbuf->b_did_warn == FALSE
if (curbuf->b_did_warn == false
&& curbufIsChanged() == 0
&& !autocmd_busy
&& curbuf->b_p_ro) {
@ -2263,7 +2263,7 @@ change_warning (
out_flush();
ui_delay(1000L, true); /* give the user time to think about it */
}
curbuf->b_did_warn = TRUE;
curbuf->b_did_warn = true;
redraw_cmdline = FALSE; /* don't redraw and erase the message */
if (msg_row < Rows - 1)
showmode();

View File

@ -1673,7 +1673,7 @@ void scroll_cursor_halfway(int atend)
curwin->w_topline = topline;
curwin->w_topfill = topfill;
if (old_topline > curwin->w_topline + curwin->w_height)
curwin->w_botfill = FALSE;
curwin->w_botfill = false;
check_topfill(curwin, false);
curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
curwin->w_valid |= VALID_TOPLINE;

View File

@ -2007,7 +2007,7 @@ void set_init_1(void)
set_options_default(0);
curbuf->b_p_initialized = TRUE;
curbuf->b_p_initialized = true;
curbuf->b_p_ar = -1; /* no local 'autoread' value */
curbuf->b_p_ul = NO_LOCAL_UNDOLEVEL;
check_buf_options(curbuf);
@ -4977,7 +4977,7 @@ set_bool_option (
/* when 'readonly' is set may give W10 again */
if (curbuf->b_p_ro)
curbuf->b_did_warn = FALSE;
curbuf->b_did_warn = false;
redraw_titles();
}
@ -5086,7 +5086,7 @@ set_bool_option (
did_set_title(FALSE);
} else if ((int *)varp == &p_icon) {
did_set_title(TRUE);
} else if ((int *)varp == &curbuf->b_changed) {
} else if ((bool *)varp == &curbuf->b_changed) {
if (!value)
save_file_ff(curbuf); /* Buffer is unchanged */
redraw_titles();
@ -5782,7 +5782,7 @@ get_option_value (
else {
/* Special case: 'modified' is b_changed, but we also want to consider
* it set when 'ff' or 'fenc' changed. */
if ((int *)varp == &curbuf->b_changed)
if ((bool *)varp == &curbuf->b_changed)
*numval = curbufIsChanged();
else
*numval = *(int *)varp;
@ -6173,8 +6173,8 @@ showoneopt (
varp = get_varp_scope(p, opt_flags);
/* for 'modified' we also need to check if 'ff' or 'fenc' changed. */
if ((p->flags & P_BOOL) && ((int *)varp == &curbuf->b_changed
? !curbufIsChanged() : !*(int *)varp))
if ((p->flags & P_BOOL) && ((bool *)varp == &curbuf->b_changed
? !curbufIsChanged() : !*(bool *)varp))
MSG_PUTS("no");
else if ((p->flags & P_BOOL) && *(int *)varp < 0)
MSG_PUTS("--");
@ -7026,7 +7026,7 @@ void buf_copy_options(buf_T *buf, int flags)
buf->b_p_isk = vim_strsave(p_isk);
did_isk = TRUE;
buf->b_p_ts = p_ts;
buf->b_help = FALSE;
buf->b_help = false;
if (buf->b_p_bt[0] == 'h')
clear_string_option(&buf->b_p_bt);
buf->b_p_ma = p_ma;
@ -7038,7 +7038,7 @@ void buf_copy_options(buf_T *buf, int flags)
* flag that indicates that the options have been initialized.
*/
if (should_copy)
buf->b_p_initialized = TRUE;
buf->b_p_initialized = true;
}
check_buf_options(buf); /* make sure we don't have NULLs */

View File

@ -604,7 +604,7 @@ static int pum_set_selected(int n, int repeat)
}
}
curbuf->b_changed = 0;
curbuf->b_changed = false;
curbuf->b_p_ma = FALSE;
curwin->w_cursor.lnum = 1;
curwin->w_cursor.col = 0;

View File

@ -554,7 +554,7 @@ void update_screen(int type)
/* Reset b_mod_set flags. Going through all windows is probably faster
* than going through all buffers (there could be many buffers). */
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
wp->w_buffer->b_mod_set = FALSE;
wp->w_buffer->b_mod_set = false;
}
updating_screen = FALSE;
@ -1672,7 +1672,7 @@ static void win_update(win_T *wp)
if (must_redraw != 0) {
/* Don't update for changes in buffer again. */
i = curbuf->b_mod_set;
curbuf->b_mod_set = FALSE;
curbuf->b_mod_set = false;
win_update(curwin);
must_redraw = 0;
curbuf->b_mod_set = i;

View File

@ -1180,7 +1180,7 @@ find_tags (
* Initialize a few variables
*/
if (help_only) /* want tags from help file */
curbuf->b_help = TRUE; /* will be restored later */
curbuf->b_help = true; /* will be restored later */
orgpat.len = (int)STRLEN(pat);
if (curbuf->b_help) {

View File

@ -369,11 +369,11 @@ int u_savecommon(linenr_T top, linenr_T bot, linenr_T newbot, int reload)
size = bot - top - 1;
/*
* If curbuf->b_u_synced == TRUE make a new header.
* If curbuf->b_u_synced == true make a new header.
*/
if (curbuf->b_u_synced) {
/* Need to create new entry in b_changelist. */
curbuf->b_new_change = TRUE;
curbuf->b_new_change = true;
if (get_undolevel() >= 0) {
/*
@ -424,7 +424,7 @@ int u_savecommon(linenr_T top, linenr_T bot, linenr_T newbot, int reload)
if (uhp == NULL) { /* no undo at all */
if (old_curhead != NULL)
u_freebranch(curbuf, old_curhead, NULL);
curbuf->b_u_synced = FALSE;
curbuf->b_u_synced = false;
return OK;
}
@ -510,7 +510,7 @@ int u_savecommon(linenr_T top, linenr_T bot, linenr_T newbot, int reload)
* entry now. Following deleted/inserted lines go to
* the re-used entry. */
u_getbot();
curbuf->b_u_synced = FALSE;
curbuf->b_u_synced = false;
/* Move the found entry to become the last entry. The
* order of undo/redo doesn't matter for the entries
@ -581,7 +581,7 @@ int u_savecommon(linenr_T top, linenr_T bot, linenr_T newbot, int reload)
uep->ue_array = NULL;
uep->ue_next = curbuf->b_u_newhead->uh_entry;
curbuf->b_u_newhead->uh_entry = uep;
curbuf->b_u_synced = FALSE;
curbuf->b_u_synced = false;
undo_undoes = FALSE;
#ifdef U_DEBUG
@ -1461,7 +1461,7 @@ void u_read_undo(char_u *name, char_u *hash, char_u *orig_name)
curbuf->b_u_save_nr_last = last_save_nr;
curbuf->b_u_save_nr_cur = last_save_nr;
curbuf->b_u_synced = TRUE;
curbuf->b_u_synced = true;
free(uhp_table);
#ifdef U_DEBUG
@ -1506,7 +1506,7 @@ void u_undo(int count)
* original vi. If this happens twice in one macro the result will not
* be compatible.
*/
if (curbuf->b_u_synced == FALSE) {
if (curbuf->b_u_synced == false) {
u_sync(TRUE);
count = 1;
}
@ -1618,7 +1618,7 @@ void undo_time(long step, int sec, int file, int absolute)
int did_undo = TRUE;
/* First make sure the current undoable change is synced. */
if (curbuf->b_u_synced == FALSE)
if (curbuf->b_u_synced == false)
u_sync(TRUE);
u_newcount = 0;
@ -2219,7 +2219,7 @@ u_sync (
if (curbuf->b_u_synced || (!force && no_u_sync > 0))
return;
if (get_undolevel() < 0)
curbuf->b_u_synced = TRUE; /* no entries, nothing to do */
curbuf->b_u_synced = true; /* no entries, nothing to do */
else {
u_getbot(); /* compute ue_bot of previous u_save */
curbuf->b_u_curhead = NULL;
@ -2354,7 +2354,7 @@ void ex_undojoin(exarg_T *eap)
else {
/* Go back to the last entry */
curbuf->b_u_curhead = curbuf->b_u_newhead;
curbuf->b_u_synced = FALSE; /* no entries, nothing to do */
curbuf->b_u_synced = false; /* no entries, nothing to do */
}
}
@ -2365,7 +2365,7 @@ void ex_undojoin(exarg_T *eap)
void u_unchanged(buf_T *buf)
{
u_unch_branch(buf->b_u_oldhead);
buf->b_did_warn = FALSE;
buf->b_did_warn = false;
}
/*
@ -2446,7 +2446,7 @@ static u_entry_T *u_get_headentry(void)
/*
* u_getbot(): compute the line number of the previous u_save
* It is called only when b_u_synced is FALSE.
* It is called only when b_u_synced is false.
*/
static void u_getbot(void)
{
@ -2477,7 +2477,7 @@ static void u_getbot(void)
curbuf->b_u_newhead->uh_getbot_entry = NULL;
}
curbuf->b_u_synced = TRUE;
curbuf->b_u_synced = true;
}
/*
@ -2602,7 +2602,7 @@ static void u_freeentry(u_entry_T *uep, long n)
void u_clearall(buf_T *buf)
{
buf->b_u_newhead = buf->b_u_oldhead = buf->b_u_curhead = NULL;
buf->b_u_synced = TRUE;
buf->b_u_synced = true;
buf->b_u_numhead = 0;
buf->b_u_line_ptr = NULL;
buf->b_u_line_lnum = 0;

View File

@ -1849,19 +1849,19 @@ int win_close(win_T *win, int free_buf)
*/
if (wp->w_buffer != curbuf) {
other_buffer = TRUE;
win->w_closing = TRUE;
win->w_closing = true;
apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
if (!win_valid(win))
return FAIL;
win->w_closing = FALSE;
win->w_closing = false;
if (last_window())
return FAIL;
}
win->w_closing = TRUE;
win->w_closing = true;
apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf);
if (!win_valid(win))
return FAIL;
win->w_closing = FALSE;
win->w_closing = false;
if (last_window())
return FAIL;
/* autocmds may abort script processing */
@ -1878,10 +1878,10 @@ int win_close(win_T *win, int free_buf)
* Close the link to the buffer.
*/
if (win->w_buffer != NULL) {
win->w_closing = TRUE;
win->w_closing = true;
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, TRUE);
if (win_valid(win))
win->w_closing = FALSE;
win->w_closing = false;
}
if (only_one_window() && win_valid(win) && win->w_buffer == NULL
@ -5404,7 +5404,7 @@ int match_add(win_T *wp, char_u *grp, char_u *pat, int prio, int id, list_T *pos
wp->w_buffer->b_mod_bot = botlnum;
}
} else {
wp->w_buffer->b_mod_set = TRUE;
wp->w_buffer->b_mod_set = true;
wp->w_buffer->b_mod_top = toplnum;
wp->w_buffer->b_mod_bot = botlnum;
wp->w_buffer->b_mod_xlines = 0;
@ -5478,7 +5478,7 @@ int match_delete(win_T *wp, int id, int perr)
wp->w_buffer->b_mod_bot = cur->pos.botlnum;
}
} else {
wp->w_buffer->b_mod_set = TRUE;
wp->w_buffer->b_mod_set = true;
wp->w_buffer->b_mod_top = cur->pos.toplnum;
wp->w_buffer->b_mod_bot = cur->pos.botlnum;
wp->w_buffer->b_mod_xlines = 0;