aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/fileio.c')
-rw-r--r--src/nvim/fileio.c214
1 files changed, 109 insertions, 105 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index cc592c2430..206ef7c98d 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -134,7 +134,7 @@ void filemess(buf_T *buf, char_u *name, char_u *s, int attr)
// calling filemess().
msg_scroll_save = msg_scroll;
if (shortmess(SHM_OVERALL) && !exiting && p_verbose == 0) {
- msg_scroll = FALSE;
+ msg_scroll = false;
}
if (!msg_scroll) { // wait a bit when overwriting an error msg
check_for_delay(false);
@@ -143,7 +143,7 @@ void filemess(buf_T *buf, char_u *name, char_u *s, int attr)
msg_scroll = msg_scroll_save;
msg_scrolled_ign = true;
// may truncate the message to avoid a hit-return prompt
- msg_outtrans_attr(msg_may_trunc(FALSE, IObuff), attr);
+ msg_outtrans_attr(msg_may_trunc(false, IObuff), attr);
msg_clr_eos();
ui_flush();
msg_scrolled_ign = false;
@@ -337,9 +337,9 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip,
}
if ((shortmess(SHM_OVER) || curbuf->b_help) && p_verbose == 0) {
- msg_scroll = FALSE; // overwrite previous file message
+ msg_scroll = false; // overwrite previous file message
} else {
- msg_scroll = TRUE; // don't overwrite previous file message
+ msg_scroll = true; // don't overwrite previous file message
}
// If the name is too long we might crash further on, quit here.
if (fname != NULL && *fname != NUL) {
@@ -402,7 +402,7 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip,
*/
check_readonly = (newfile && (curbuf->b_flags & BF_CHECK_RO));
if (check_readonly && !readonlymode) {
- curbuf->b_p_ro = FALSE;
+ curbuf->b_p_ro = false;
}
if (newfile && !read_stdin && !read_buffer && !read_fifo) {
@@ -518,18 +518,18 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip,
* loaded. Help files always get readonly mode
*/
if ((check_readonly && file_readonly) || curbuf->b_help) {
- curbuf->b_p_ro = TRUE;
+ curbuf->b_p_ro = true;
}
if (set_options) {
// Don't change 'eol' if reading from buffer as it will already be
// correctly set when reading stdin.
if (!read_buffer) {
- curbuf->b_p_eol = TRUE;
- curbuf->b_start_eol = TRUE;
+ curbuf->b_p_eol = true;
+ curbuf->b_start_eol = true;
}
- curbuf->b_p_bomb = FALSE;
- curbuf->b_start_bomb = FALSE;
+ curbuf->b_p_bomb = false;
+ curbuf->b_start_bomb = false;
}
// Create a swap file now, so that other Vims are warned that we are
@@ -635,7 +635,7 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip,
if (aborting()) { // autocmds may abort script processing
no_wait_return--;
msg_scroll = msg_save;
- curbuf->b_p_ro = TRUE; // must use "w!" now
+ curbuf->b_p_ro = true; // must use "w!" now
return FAIL;
}
/*
@@ -656,7 +656,7 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip,
} else {
emsg(_("E201: *ReadPre autocommands must not change current buffer"));
}
- curbuf->b_p_ro = TRUE; // must use "w!" now
+ curbuf->b_p_ro = true; // must use "w!" now
return FAIL;
}
}
@@ -670,7 +670,7 @@ int readfile(char *fname, char *sfname, linenr_T from, linenr_T lines_to_skip,
}
}
- msg_scroll = FALSE; // overwrite the file message
+ msg_scroll = false; // overwrite the file message
/*
* Set linecnt now, before the "retry" caused by a wrong guess for
@@ -751,8 +751,8 @@ retry:
}
file_rewind = false;
if (set_options) {
- curbuf->b_p_bomb = FALSE;
- curbuf->b_start_bomb = FALSE;
+ curbuf->b_p_bomb = false;
+ curbuf->b_start_bomb = false;
}
conv_error = 0;
}
@@ -766,7 +766,7 @@ retry:
} else {
if (eap != NULL && eap->force_ff != 0) {
fileformat = get_fileformat_force(curbuf, eap);
- try_unix = try_dos = try_mac = FALSE;
+ try_unix = try_dos = try_mac = false;
} else if (curbuf->b_p_bin) {
fileformat = EOL_UNIX; // binary: use Unix format
} else if (*p_ffs ==
@@ -892,7 +892,7 @@ retry:
}
// Set "can_retry" when it's possible to rewind the file and try with
- // another "fenc" value. It's FALSE when no other "fenc" to try, reading
+ // another "fenc" value. It's false when no other "fenc" to try, reading
// stdin or fixed at a specific encoding.
can_retry = (*fenc != NUL && !read_stdin && !keep_dest_enc && !read_fifo);
@@ -1138,8 +1138,8 @@ retry:
size -= blen;
memmove(ptr, ptr + blen, (size_t)size);
if (set_options) {
- curbuf->b_p_bomb = TRUE;
- curbuf->b_start_bomb = TRUE;
+ curbuf->b_p_bomb = true;
+ curbuf->b_start_bomb = true;
}
}
@@ -1672,7 +1672,7 @@ failed:
&& ptr == line_start + 1)) {
// remember for when writing
if (set_options) {
- curbuf->b_p_eol = FALSE;
+ curbuf->b_p_eol = false;
}
*ptr = NUL;
len = (colnr_T)(ptr - line_start + 1);
@@ -1773,7 +1773,7 @@ failed:
if (!(flags & READ_DUMMY)) {
filemess(curbuf, (char_u *)sfname, (char_u *)_(e_interr), 0);
if (newfile) {
- curbuf->b_p_ro = TRUE; // must use "w!" now
+ curbuf->b_p_ro = true; // must use "w!" now
}
}
msg_scroll = msg_save;
@@ -1788,30 +1788,30 @@ failed:
#ifdef UNIX
if (S_ISFIFO(perm)) { // fifo
STRCAT(IObuff, _("[fifo]"));
- c = TRUE;
+ c = true;
}
if (S_ISSOCK(perm)) { // or socket
STRCAT(IObuff, _("[socket]"));
- c = TRUE;
+ c = true;
}
# ifdef OPEN_CHR_FILES
if (S_ISCHR(perm)) { // or character special
STRCAT(IObuff, _("[character special]"));
- c = TRUE;
+ c = true;
}
# endif
#endif
if (curbuf->b_p_ro) {
STRCAT(IObuff, shortmess(SHM_RO) ? _("[RO]") : _("[readonly]"));
- c = TRUE;
+ c = true;
}
if (read_no_eol_lnum) {
msg_add_eol();
- c = TRUE;
+ c = true;
}
if (ff_error == EOL_DOS) {
STRCAT(IObuff, _("[CR missing]"));
- c = TRUE;
+ c = true;
}
if (split) {
STRCAT(IObuff, _("[long lines split]"));
@@ -1819,25 +1819,25 @@ failed:
}
if (notconverted) {
STRCAT(IObuff, _("[NOT converted]"));
- c = TRUE;
+ c = true;
} else if (converted) {
STRCAT(IObuff, _("[converted]"));
- c = TRUE;
+ c = true;
}
if (conv_error != 0) {
sprintf((char *)IObuff + STRLEN(IObuff),
_("[CONVERSION ERROR in line %" PRId64 "]"), (int64_t)conv_error);
- c = TRUE;
+ c = true;
} else if (illegal_byte > 0) {
sprintf((char *)IObuff + STRLEN(IObuff),
_("[ILLEGAL BYTE in line %" PRId64 "]"), (int64_t)illegal_byte);
- c = TRUE;
+ c = true;
} else if (error) {
STRCAT(IObuff, _("[READ ERRORS]"));
- c = TRUE;
+ c = true;
}
if (msg_add_fileformat(fileformat)) {
- c = TRUE;
+ c = true;
}
msg_add_lines(c, (long)linecnt, filesize);
@@ -1865,9 +1865,8 @@ failed:
// with errors writing the file requires ":w!"
if (newfile && (error
|| conv_error != 0
- || (illegal_byte > 0 && bad_char_behavior != BAD_KEEP)
- )) {
- curbuf->b_p_ro = TRUE;
+ || (illegal_byte > 0 && bad_char_behavior != BAD_KEEP))) {
+ curbuf->b_p_ro = true;
}
u_clearline(); // cannot use "U" command after adding lines
@@ -2021,8 +2020,8 @@ void prep_exarg(exarg_T *eap, const buf_T *buf)
eap->force_ff = *buf->b_p_ff;
eap->force_bin = buf->b_p_bin ? FORCE_BIN : FORCE_NOBIN;
- eap->read_edit = FALSE;
- eap->forceit = FALSE;
+ eap->read_edit = false;
+ eap->forceit = false;
}
/// Set default or forced 'fileformat' and 'binary'.
@@ -2161,9 +2160,9 @@ char *new_file_message(void)
///
/// If "forceit" is true, we don't care for errors when attempting backups.
/// In case of an error everything possible is done to restore the original
-/// file. But when "forceit" is TRUE, we risk losing it.
+/// file. But when "forceit" is true, we risk losing it.
///
-/// When "reset_changed" is TRUE and "append" == FALSE and "start" == 1 and
+/// When "reset_changed" is true and "append" == false and "start" == 1 and
/// "end" == curbuf->b_ml.ml_line_count, reset curbuf->b_changed.
///
/// This function must NOT use NameBuff (because it's called by autowrite()).
@@ -2204,9 +2203,9 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
int bufsize;
long perm; // file permissions
int retval = OK;
- int newfile = false; // TRUE if file doesn't exist yet
+ int newfile = false; // true if file doesn't exist yet
int msg_save = msg_scroll;
- int overwriting; // TRUE if writing over original
+ int overwriting; // true if writing over original
int no_eol = false; // no end-of-line written
int device = false; // writing to a device
int prev_got_int = got_int;
@@ -2215,7 +2214,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
static char *err_readonly =
"is read-only (cannot override: \"W\" in 'cpoptions')";
#if defined(UNIX)
- int made_writable = FALSE; // 'w' bit has been set
+ int made_writable = false; // 'w' bit has been set
#endif
// writing everything
int whole = (start == 1 && end == buf->b_ml.ml_line_count);
@@ -2234,7 +2233,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
vim_acl_T acl = NULL; /* ACL copied from original file to
backup or new file */
#endif
- int write_undo_file = FALSE;
+ int write_undo_file = false;
context_sha256_T sha_ctx;
unsigned int bkc = get_bkc_value(buf);
const pos_T orig_start = buf->b_op_start;
@@ -2266,7 +2265,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
// must init bw_conv_buf and bw_iconv_fd before jumping to "fail"
write_info.bw_conv_buf = NULL;
- write_info.bw_conv_error = FALSE;
+ write_info.bw_conv_error = false;
write_info.bw_conv_error_lnum = 0;
write_info.bw_restlen = 0;
#ifdef HAVE_ICONV
@@ -2314,7 +2313,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
if (buf->b_ffname != NULL && FNAMECMP(ffname, buf->b_ffname) == 0) {
overwriting = true;
} else {
- overwriting = FALSE;
+ overwriting = false;
}
no_wait_return++; // don't wait for return yet
@@ -2329,12 +2328,12 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
{
aco_save_T aco;
- int buf_ffname = FALSE;
- int buf_sfname = FALSE;
- int buf_fname_f = FALSE;
- int buf_fname_s = FALSE;
- int did_cmd = FALSE;
- int nofile_err = FALSE;
+ int buf_ffname = false;
+ int buf_sfname = false;
+ int buf_fname_f = false;
+ int buf_fname_s = false;
+ int did_cmd = false;
+ int nofile_err = false;
int empty_memline = (buf->b_ml.ml_mfp == NULL);
bufref_T bufref;
@@ -2512,9 +2511,9 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
}
if (shortmess(SHM_OVER) && !exiting) {
- msg_scroll = FALSE; // overwrite previous file message
+ msg_scroll = false; // overwrite previous file message
} else {
- msg_scroll = TRUE; // don't overwrite previous file message
+ msg_scroll = true; // don't overwrite previous file message
}
if (!filtering) {
filemess(buf,
@@ -2525,7 +2524,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
#endif
(char_u *)"", 0); // show that we are busy
}
- msg_scroll = FALSE; // always overwrite the file message now
+ msg_scroll = false; // always overwrite the file message now
buffer = verbose_try_malloc(BUFSIZE);
// can't allocate big buffer, use small one (to be able to write when out of
@@ -2558,8 +2557,8 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
}
/* It's a device of some kind (or a fifo) which we can write to
* but for which we can't make a backup. */
- device = TRUE;
- newfile = TRUE;
+ device = true;
+ newfile = true;
perm = -1;
}
}
@@ -2571,8 +2570,8 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
goto fail;
}
if (c == NODE_WRITABLE) {
- device = TRUE;
- newfile = TRUE;
+ device = true;
+ newfile = true;
perm = -1;
} else {
perm = os_getperm((const char *)fname);
@@ -2638,7 +2637,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
* abort it.
*/
prev_got_int = got_int;
- got_int = FALSE;
+ got_int = false;
// Mark the buffer as 'being saved' to prevent changed buffer warnings
buf->b_saving = true;
@@ -2656,7 +2655,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
const bool no_prepend_dot = false;
if ((bkc & BKC_YES) || append) { // "yes"
- backup_copy = TRUE;
+ backup_copy = true;
} else if ((bkc & BKC_AUTO)) { // "auto"
int i;
@@ -2669,7 +2668,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
if (os_fileinfo_hardlinks(&file_info_old) > 1
|| !os_fileinfo_link(fname, &file_info)
|| !os_fileinfo_id_equal(&file_info, &file_info_old)) {
- backup_copy = TRUE;
+ backup_copy = true;
} else {
/*
* Check if we can create a file and set the owner/group to
@@ -2689,7 +2688,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
fd = os_open((char *)IObuff,
O_CREAT|O_WRONLY|O_EXCL|O_NOFOLLOW, (int)perm);
if (fd < 0) { // can't write in directory
- backup_copy = TRUE;
+ backup_copy = true;
} else {
#ifdef UNIX
os_fchown(fd, (uv_uid_t)file_info_old.stat.st_uid, (uv_gid_t)file_info_old.stat.st_gid);
@@ -2697,7 +2696,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
|| file_info.stat.st_uid != file_info_old.stat.st_uid
|| file_info.stat.st_gid != file_info_old.stat.st_gid
|| (long)file_info.stat.st_mode != perm) {
- backup_copy = TRUE;
+ backup_copy = true;
}
#endif
/* Close the file before removing it, on MS-Windows we
@@ -2719,7 +2718,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
if ((bkc & BKC_BREAKSYMLINK)
&& file_info_link_ok
&& !os_fileinfo_id_equal(&file_info, &file_info_old)) {
- backup_copy = FALSE;
+ backup_copy = false;
}
// Hardlinks.
@@ -2727,7 +2726,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
&& os_fileinfo_hardlinks(&file_info_old) > 1
&& (!file_info_link_ok
|| os_fileinfo_id_equal(&file_info, &file_info_old))) {
- backup_copy = FALSE;
+ backup_copy = false;
}
#endif
}
@@ -2789,7 +2788,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
rootname = (char *)get_file_in_dir((char_u *)fname, IObuff);
if (rootname == NULL) {
- some_error = TRUE; // out of memory
+ some_error = true; // out of memory
goto nobackup;
}
@@ -2804,7 +2803,7 @@ int buf_write(buf_T *buf, char *fname, char *sfname, linenr_T start, linenr_T en
if (backup == NULL) {
xfree(rootname);
- some_error = TRUE; // out of memory
+ some_error = true; // out of memory
goto nobackup;
}
@@ -2889,7 +2888,7 @@ nobackup:
if (backup == NULL && errmsg == NULL) {
SET_ERRMSG(_("E509: Cannot create backup file (add ! to override)"));
}
- // Ignore errors when forceit is TRUE.
+ // Ignore errors when forceit is true.
if ((some_error || errmsg != NULL) && !forceit) {
retval = FAIL;
goto fail;
@@ -3089,8 +3088,8 @@ nobackup:
if (!write_info.bw_conv_buf) {
end = 0;
}
- write_info.bw_first = TRUE;
- } else
+ write_info.bw_first = true;
+ } else {
#endif
/*
@@ -3106,6 +3105,11 @@ nobackup:
}
}
}
+
+#ifdef HAVE_ICONV
+}
+#endif
+
if (converted && wb_flags == 0
#ifdef HAVE_ICONV
&& write_info.bw_iconv_fd == (iconv_t)-1
@@ -3115,7 +3119,7 @@ nobackup:
SET_ERRMSG(_("E213: Cannot convert (add ! to write without conversion)"));
goto restore_backup;
}
- notconverted = TRUE;
+ notconverted = true;
}
// If conversion is taking place, we may first pretend to write and check
@@ -3137,12 +3141,12 @@ nobackup:
} else {
// Open the file "wfname" for writing.
// We may try to open the file twice: If we can't write to the file
- // and forceit is TRUE we delete the existing file and try to
+ // and forceit is true we delete the existing file and try to
// create a new one. If this still fails we may have lost the
// original file! (this may happen when the user reached his
// quotum for number of files).
// Appending will fail if the file does not exist and forceit is
- // FALSE.
+ // false.
while ((fd = os_open(wfname,
O_WRONLY |
(append ?
@@ -3366,7 +3370,7 @@ restore_backup:
// been written to disk and we don't lose it.
// For a device do try the fsync() but don't complain if it does not work
// (could be a pipe).
- // If the 'fsync' option is FALSE, don't fsync(). Useful for laptops.
+ // If the 'fsync' option is false, don't fsync(). Useful for laptops.
int error;
if (p_fs && (error = os_fsync(fd)) != 0 && !device
// fsync not supported on this storage.
@@ -3495,32 +3499,32 @@ restore_backup:
c = false;
if (write_info.bw_conv_error) {
STRCAT(IObuff, _(" CONVERSION ERROR"));
- c = TRUE;
+ c = true;
if (write_info.bw_conv_error_lnum != 0) {
vim_snprintf_add((char *)IObuff, IOSIZE, _(" in line %" PRId64 ";"),
(int64_t)write_info.bw_conv_error_lnum);
}
} else if (notconverted) {
STRCAT(IObuff, _("[NOT converted]"));
- c = TRUE;
+ c = true;
} else if (converted) {
STRCAT(IObuff, _("[converted]"));
- c = TRUE;
+ c = true;
}
if (device) {
STRCAT(IObuff, _("[Device]"));
- c = TRUE;
+ c = true;
} else if (newfile) {
STRCAT(IObuff, new_file_message());
c = true;
}
if (no_eol) {
msg_add_eol();
- c = TRUE;
+ c = true;
}
// may add [unix/dos/mac]
if (msg_add_fileformat(fileformat)) {
- c = TRUE;
+ c = true;
}
msg_add_lines(c, (long)lnum, nchars); // add line/char count
if (!shortmess(SHM_WRITE)) {
@@ -3711,23 +3715,23 @@ nofail:
if (append) {
apply_autocmds_exarg(EVENT_FILEAPPENDPOST, fname, fname,
- FALSE, curbuf, eap);
+ false, curbuf, eap);
} else if (filtering) {
apply_autocmds_exarg(EVENT_FILTERWRITEPOST, NULL, fname,
- FALSE, curbuf, eap);
+ false, curbuf, eap);
} else if (reset_changed && whole) {
apply_autocmds_exarg(EVENT_BUFWRITEPOST, fname, fname,
- FALSE, curbuf, eap);
+ false, curbuf, eap);
} else {
apply_autocmds_exarg(EVENT_FILEWRITEPOST, fname, fname,
- FALSE, curbuf, eap);
+ false, curbuf, eap);
}
// restore curwin/curbuf and a few other things
aucmd_restbuf(&aco);
if (aborting()) { // autocmds may abort script processing
- retval = FALSE;
+ retval = false;
}
}
@@ -3994,7 +3998,7 @@ static int buf_write_bytes(struct bw_info *ip)
}
if (ucs2bytes(c, &p, flags) && !ip->bw_conv_error) {
- ip->bw_conv_error = TRUE;
+ ip->bw_conv_error = true;
ip->bw_conv_error_lnum = ip->bw_start_lnum;
}
if (c == NL) {
@@ -4049,7 +4053,7 @@ static int buf_write_bytes(struct bw_info *ip)
to = (char *)ip->bw_conv_buf;
tolen = save_len;
}
- ip->bw_first = FALSE;
+ ip->bw_first = false;
}
/*
@@ -4058,7 +4062,7 @@ static int buf_write_bytes(struct bw_info *ip)
if ((iconv(ip->bw_iconv_fd, (void *)&from, &fromlen, &to, &tolen)
== (size_t)-1 && ICONV_ERRNO != ICONV_EINVAL)
|| fromlen > CONV_RESTLEN) {
- ip->bw_conv_error = TRUE;
+ ip->bw_conv_error = true;
return FAIL;
}
@@ -4163,7 +4167,7 @@ static bool need_conversion(const char_u *fenc)
int fenc_flags;
if (*fenc == NUL || STRCMP(p_enc, fenc) == 0) {
- same_encoding = TRUE;
+ same_encoding = true;
fenc_flags = 0;
} else {
// Ignore difference between "ansi" and "latin1", "ucs-4" and
@@ -4296,10 +4300,10 @@ static int make_bom(char_u *buf, char_u *name)
/// Shorten filename of a buffer.
///
-/// @param force when TRUE: Use full path from now on for files currently being
+/// @param force when true: Use full path from now on for files currently being
/// edited, both for file name and swap file name. Try to shorten the file
/// names a bit, if safe to do so.
-/// when FALSE: Only try to shorten absolute file names.
+/// when false: Only try to shorten absolute file names.
///
/// For buffers that have buftype "nofile" or "scratch": never change the file
/// name.
@@ -4386,7 +4390,7 @@ char *modname(const char *fname, const char *ext, bool prepend_dot)
}
add_pathsep(retval);
fnamelen = strlen(retval);
- prepend_dot = FALSE; // nothing to prepend a dot to
+ prepend_dot = false; // nothing to prepend a dot to
} else {
fnamelen = strlen(fname);
retval = xmalloc(fnamelen + extlen + 3);
@@ -4769,7 +4773,7 @@ int vim_rename(const char_u *from, const char_u *to)
return 0;
}
-static int already_warned = FALSE;
+static int already_warned = false;
/// Check if any not hidden buffer has been changed.
/// Postpone the check if there are characters in the stuff buffer, a global
@@ -4778,7 +4782,7 @@ static int already_warned = FALSE;
///
/// @param focus called for GUI focus event
///
-/// @return TRUE if some message was written (screen should be redrawn and cursor positioned).
+/// @return true if some message was written (screen should be redrawn and cursor positioned).
int check_timestamps(int focus)
{
int didit = 0;
@@ -4786,15 +4790,15 @@ int check_timestamps(int focus)
// Don't check timestamps while system() or another low-level function may
// cause us to lose and gain focus.
if (no_check_timestamps > 0) {
- return FALSE;
+ return false;
}
// Avoid doing a check twice. The OK/Reload dialog can cause a focus
// event and we would keep on checking if the file is steadily growing.
// Do check again after typing something.
if (focus && did_check_timestamps) {
- need_check_timestamps = TRUE;
- return FALSE;
+ need_check_timestamps = true;
+ return false;
}
if (!stuff_empty() || global_busy || !typebuf_typed()
@@ -5075,7 +5079,7 @@ int buf_check_timestamp(buf_T *buf)
redraw_cmdline = false;
}
}
- already_warned = TRUE;
+ already_warned = true;
}
xfree(path);
@@ -5606,8 +5610,8 @@ bool match_file_list(char_u *list, char_u *sfname, char_u *ffname)
/// Convert the given pattern "pat" which has shell style wildcards in it, into
/// a regular expression, and return the result in allocated memory. If there
-/// is a directory path separator to be matched, then TRUE is put in
-/// allow_dirs, otherwise FALSE is put there -- webb.
+/// is a directory path separator to be matched, then true is put in
+/// allow_dirs, otherwise false is put there -- webb.
/// Handle backslashes before special characters, like "\*" and "\ ".
///
/// @param pat_end first char after pattern or NULL
@@ -5625,7 +5629,7 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs
bool add_dollar = true;
if (allow_dirs != NULL) {
- *allow_dirs = FALSE;
+ *allow_dirs = false;
}
if (pat_end == NULL) {
pat_end = pat + STRLEN(pat);
@@ -5711,7 +5715,7 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs
reg_pat[i++] = '/';
reg_pat[i++] = ']';
if (allow_dirs != NULL) {
- *allow_dirs = TRUE;
+ *allow_dirs = true;
}
break;
}
@@ -5745,7 +5749,7 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs
&& (!no_bslash || *p != '\\')
#endif
) {
- *allow_dirs = TRUE;
+ *allow_dirs = true;
}
reg_pat[i++] = '\\';
reg_pat[i++] = *p;
@@ -5758,7 +5762,7 @@ char *file_pat_to_reg_pat(const char *pat, const char *pat_end, char *allow_dirs
reg_pat[i++] = '/';
reg_pat[i++] = ']';
if (allow_dirs != NULL) {
- *allow_dirs = TRUE;
+ *allow_dirs = true;
}
break;
#endif