aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/buffer.c12
-rw-r--r--src/nvim/diff.c2
-rw-r--r--src/nvim/edit.c2
-rw-r--r--src/nvim/eval.c2
-rw-r--r--src/nvim/ex_cmds.c12
-rw-r--r--src/nvim/ex_docmd.c6
-rw-r--r--src/nvim/fileio.c2
-rw-r--r--src/nvim/globals.h6
-rw-r--r--src/nvim/if_cscope.c4
-rw-r--r--src/nvim/main.c6
-rw-r--r--src/nvim/memory.c4
-rw-r--r--src/nvim/misc1.c4
-rw-r--r--src/nvim/move.c18
-rw-r--r--src/nvim/normal.c12
-rw-r--r--src/nvim/os_unix.c4
-rw-r--r--src/nvim/popupmnu.c6
-rw-r--r--src/nvim/quickfix.c2
-rw-r--r--src/nvim/screen.c2
-rw-r--r--src/nvim/search.c10
-rw-r--r--src/nvim/syntax.c2
-rw-r--r--src/nvim/tag.c8
-rw-r--r--src/nvim/term.c4
-rw-r--r--src/nvim/ui.c40
-rw-r--r--src/nvim/window.c20
24 files changed, 95 insertions, 95 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 2152502c95..44f3d2ea63 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -1405,7 +1405,7 @@ buflist_new (
EMSG(_("W14: Warning: List of file names overflow"));
if (emsg_silent == 0) {
out_flush();
- ui_delay(3000L, TRUE); /* make sure it is noticed */
+ ui_delay(3000L, true); /* make sure it is noticed */
}
top_file_num = 1;
}
@@ -3734,7 +3734,7 @@ do_arg_all (
++autocmd_no_leave;
last_curwin = curwin;
last_curtab = curtab;
- win_enter(lastwin, FALSE);
+ win_enter(lastwin, false);
/* ":drop all" should re-use an empty window to avoid "--remote-tab"
* leaving an empty tab page when executed locally. */
if (keep_tabs && bufempty() && curbuf->b_nwindows == 1
@@ -3802,13 +3802,13 @@ do_arg_all (
if (valid_tabpage(last_curtab))
goto_tabpage_tp(last_curtab, TRUE, TRUE);
if (win_valid(last_curwin))
- win_enter(last_curwin, FALSE);
+ win_enter(last_curwin, false);
}
/* to window with first arg */
if (valid_tabpage(new_curtab))
goto_tabpage_tp(new_curtab, TRUE, TRUE);
if (win_valid(new_curwin))
- win_enter(new_curwin, FALSE);
+ win_enter(new_curwin, false);
--autocmd_no_leave;
free(opened);
@@ -3883,7 +3883,7 @@ void ex_buffer_all(exarg_T *eap)
*/
/* Don't execute Win/Buf Enter/Leave autocommands here. */
++autocmd_no_enter;
- win_enter(lastwin, FALSE);
+ win_enter(lastwin, false);
++autocmd_no_leave;
for (buf = firstbuf; buf != NULL && open_wins < count; buf = buf->b_next) {
/* Check if this buffer needs a window */
@@ -3963,7 +3963,7 @@ void ex_buffer_all(exarg_T *eap)
cmdmod.tab = 9999;
}
--autocmd_no_enter;
- win_enter(firstwin, FALSE); /* back to first window */
+ win_enter(firstwin, false); /* back to first window */
--autocmd_no_leave;
/*
diff --git a/src/nvim/diff.c b/src/nvim/diff.c
index c125b726c4..1cea6e759e 100644
--- a/src/nvim/diff.c
+++ b/src/nvim/diff.c
@@ -1762,7 +1762,7 @@ void diff_set_topline(win_T *fromwin, win_T *towin)
invalidate_botline_win(towin);
changed_line_abv_curs_win(towin);
- check_topfill(towin, FALSE);
+ check_topfill(towin, false);
(void)hasFoldingWin(towin, towin->w_topline, &towin->w_topline,
NULL, TRUE, NULL);
}
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index c0a99baf0f..f1914a09dd 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1752,7 +1752,7 @@ static int has_compl_option(int dict_opt)
vim_beep();
setcursor();
out_flush();
- ui_delay(2000L, FALSE);
+ ui_delay(2000L, false);
}
return FALSE;
}
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 15967f484b..225ea12230 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -14667,7 +14667,7 @@ static void f_winrestview(typval_T *argvars, typval_T *rettv)
curwin->w_topline = 1;
if (curwin->w_topline > curbuf->b_ml.ml_line_count)
curwin->w_topline = curbuf->b_ml.ml_line_count;
- check_topfill(curwin, TRUE);
+ check_topfill(curwin, true);
}
}
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index a04f93a851..f17bf33f19 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -4595,9 +4595,9 @@ void free_old_sub(void)
* Set up for a tagpreview.
* Return TRUE when it was created.
*/
-int
+bool
prepare_tagpreview (
- int undo_sync /* sync undo when leaving the window */
+ bool undo_sync /* sync undo when leaving the window */
)
{
win_T *wp;
@@ -4618,17 +4618,17 @@ prepare_tagpreview (
*/
if (win_split(g_do_tagpreview > 0 ? g_do_tagpreview : 0, 0)
== FAIL)
- return FALSE;
+ return false;
curwin->w_p_pvw = TRUE;
curwin->w_p_wfh = TRUE;
RESET_BINDING(curwin); /* don't take over 'scrollbind'
and 'cursorbind' */
curwin->w_p_diff = FALSE; /* no 'diff' */
curwin->w_p_fdc = 0; /* no 'foldcolumn' */
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
@@ -4735,7 +4735,7 @@ void ex_help(exarg_T *eap)
if (wp->w_buffer != NULL && wp->w_buffer->b_help)
break;
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
- win_enter(wp, TRUE);
+ win_enter(wp, true);
else {
/*
* There is no help window yet.
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 963fd33371..aa6e68dd4b 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -6411,7 +6411,7 @@ void do_sleep(long msec)
cursor_on();
out_flush();
for (done = 0; !got_int && done < msec; done += 1000L) {
- ui_delay(msec - done > 1000L ? 1000L : msec - done, TRUE);
+ ui_delay(msec - done > 1000L ? 1000L : msec - done, true);
ui_breakcheck();
}
}
@@ -7405,7 +7405,7 @@ static void ex_pedit(exarg_T *eap)
win_T *curwin_save = curwin;
g_do_tagpreview = p_pvh;
- prepare_tagpreview(TRUE);
+ prepare_tagpreview(true);
keep_help_flag = curwin_save->w_buffer->b_help;
do_exedit(eap, NULL);
keep_help_flag = FALSE;
@@ -7413,7 +7413,7 @@ static void ex_pedit(exarg_T *eap)
/* Return cursor to where we were */
validate_cursor();
redraw_later(VALID);
- win_enter(curwin_save, TRUE);
+ win_enter(curwin_save, true);
}
g_do_tagpreview = 0;
}
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 6f21679549..b87b606f98 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -4966,7 +4966,7 @@ buf_check_timestamp (
if (emsg_silent == 0) {
out_flush();
/* give the user some time to think about it */
- ui_delay(1000L, TRUE);
+ ui_delay(1000L, true);
/* don't redraw and erase the message */
redraw_cmdline = FALSE;
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 1035788d03..612609c2a5 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -359,8 +359,8 @@ EXTERN buf_T *au_pending_free_buf INIT(= NULL);
*/
EXTERN int mouse_row;
EXTERN int mouse_col;
-EXTERN int mouse_past_bottom INIT(= FALSE); /* mouse below last line */
-EXTERN int mouse_past_eol INIT(= FALSE); /* mouse right of line */
+EXTERN bool mouse_past_bottom INIT(= false); /* mouse below last line */
+EXTERN bool mouse_past_eol INIT(= false); /* mouse right of line */
EXTERN int mouse_dragging INIT(= 0); /* extending Visual area with
mouse dragging */
/*
@@ -720,7 +720,7 @@ EXTERN char_u *exe_name; /* the name of the executable */
EXTERN int dont_scroll INIT(= FALSE); /* don't use scrollbars when TRUE */
#endif
EXTERN int mapped_ctrl_c INIT(= FALSE); /* CTRL-C is mapped */
-EXTERN int ctrl_c_interrupts INIT(= TRUE); /* CTRL-C sets got_int */
+EXTERN bool ctrl_c_interrupts INIT(= true); /* CTRL-C sets got_int */
EXTERN cmdmod_T cmdmod; /* Ex command modifiers */
diff --git a/src/nvim/if_cscope.c b/src/nvim/if_cscope.c
index 73dac908e9..94fbc15ede 100644
--- a/src/nvim/if_cscope.c
+++ b/src/nvim/if_cscope.c
@@ -1886,7 +1886,7 @@ static void cs_release_csp(int i, int freefnpp)
waitpid_errno = errno;
if (pid != 0)
break; /* break unless the process is still running */
- os_delay(50L, FALSE); /* sleep 50 ms */
+ os_delay(50L, false); /* sleep 50 ms */
}
# endif
/*
@@ -1917,7 +1917,7 @@ static void cs_release_csp(int i, int freefnpp)
alive = FALSE; /* cscope process no longer exists */
break;
}
- os_delay(50L, FALSE); /* sleep 50ms */
+ os_delay(50L, false); /* sleep 50ms */
}
}
if (alive)
diff --git a/src/nvim/main.c b/src/nvim/main.c
index 7b567be564..620f150f46 100644
--- a/src/nvim/main.c
+++ b/src/nvim/main.c
@@ -1602,7 +1602,7 @@ static void check_tty(mparm_T *parmp)
mch_errmsg(_("Vim: Warning: Input is not from a terminal\n"));
out_flush();
if (scriptin[0] == NULL)
- ui_delay(2000L, TRUE);
+ ui_delay(2000L, true);
TIME_MSG("Warning delay");
}
}
@@ -1793,7 +1793,7 @@ static void edit_buffers(mparm_T *parmp)
} else {
if (curwin->w_next == NULL) /* just checking */
break;
- win_enter(curwin->w_next, FALSE);
+ win_enter(curwin->w_next, false);
}
}
advance = TRUE;
@@ -1847,7 +1847,7 @@ static void edit_buffers(mparm_T *parmp)
break;
}
}
- win_enter(win, FALSE);
+ win_enter(win, false);
--autocmd_no_leave;
TIME_MSG("editing files in windows");
diff --git a/src/nvim/memory.c b/src/nvim/memory.c
index 3c6430f311..85c07a299e 100644
--- a/src/nvim/memory.c
+++ b/src/nvim/memory.c
@@ -376,13 +376,13 @@ void do_outofmem_msg(size_t size)
void free_all_mem(void)
{
buf_T *buf, *nextbuf;
- static int entered = FALSE;
+ static bool entered = false;
/* When we cause a crash here it is caught and Vim tries to exit cleanly.
* Don't try freeing everything again. */
if (entered)
return;
- entered = TRUE;
+ entered = true;
block_autocmds(); /* don't want to trigger autocommands here */
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index c4b2977435..16ace76e0a 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -1834,7 +1834,7 @@ void changed(void)
* and don't let the emsg() set msg_scroll. */
if (need_wait_return && emsg_silent == 0) {
out_flush();
- ui_delay(2000L, TRUE);
+ ui_delay(2000L, true);
wait_return(TRUE);
msg_scroll = save_msg_scroll;
}
@@ -2257,7 +2257,7 @@ change_warning (
(void)msg_end();
if (msg_silent == 0 && !silent_mode) {
out_flush();
- ui_delay(1000L, TRUE); /* give the user time to think about it */
+ ui_delay(1000L, true); /* give the user time to think about it */
}
curbuf->b_did_warn = TRUE;
redraw_cmdline = FALSE; /* don't redraw and erase the message */
diff --git a/src/nvim/move.c b/src/nvim/move.c
index d05dc5ca41..991b09794f 100644
--- a/src/nvim/move.c
+++ b/src/nvim/move.c
@@ -986,7 +986,7 @@ scrolldown (
if (curwin->w_cursor.lnum == curwin->w_topline)
curwin->w_cline_row = 0;
- check_topfill(curwin, TRUE);
+ check_topfill(curwin, true);
/*
* Compute the row number of the last row of the cursor line
@@ -1064,7 +1064,7 @@ scrollup (
if (curwin->w_botline > curbuf->b_ml.ml_line_count + 1)
curwin->w_botline = curbuf->b_ml.ml_line_count + 1;
- check_topfill(curwin, FALSE);
+ check_topfill(curwin, false);
if (hasAnyFolding(curwin))
/* Make sure w_topline is at the first of a sequence of folded lines. */
@@ -1085,7 +1085,7 @@ scrollup (
void
check_topfill (
win_T *wp,
- int down /* when TRUE scroll down when not enough space */
+ bool down /* when TRUE scroll down when not enough space */
)
{
int n;
@@ -1161,7 +1161,7 @@ void scrolldown_clamp(void)
if (end_row < curwin->w_height - p_so) {
if (can_fill) {
++curwin->w_topfill;
- check_topfill(curwin, TRUE);
+ check_topfill(curwin, true);
} else {
--curwin->w_topline;
curwin->w_topfill = 0;
@@ -1395,7 +1395,7 @@ void scroll_cursor_top(int min_scroll, int always)
if (curwin->w_topfill < 0)
curwin->w_topfill = 0;
}
- check_topfill(curwin, FALSE);
+ check_topfill(curwin, false);
if (curwin->w_topline != old_topline
|| curwin->w_topfill != old_topfill
)
@@ -1658,7 +1658,7 @@ void scroll_cursor_halfway(int atend)
curwin->w_topfill = topfill;
if (old_topline > curwin->w_topline + curwin->w_height)
curwin->w_botfill = FALSE;
- check_topfill(curwin, FALSE);
+ check_topfill(curwin, false);
curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
curwin->w_valid |= VALID_TOPLINE;
}
@@ -1829,7 +1829,7 @@ int onepage(int dir, long count)
get_scroll_overlap(&loff, -1);
curwin->w_topline = loff.lnum;
curwin->w_topfill = loff.fill;
- check_topfill(curwin, FALSE);
+ check_topfill(curwin, false);
curwin->w_cursor.lnum = curwin->w_topline;
curwin->w_valid &= ~(VALID_WCOL|VALID_CHEIGHT|VALID_WROW|
VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
@@ -1916,7 +1916,7 @@ int onepage(int dir, long count)
} else {
curwin->w_topline = loff.lnum;
curwin->w_topfill = loff.fill;
- check_topfill(curwin, FALSE);
+ check_topfill(curwin, false);
curwin->w_valid &= ~(VALID_WROW|VALID_CROW|VALID_BOTLINE);
}
}
@@ -2011,7 +2011,7 @@ static void get_scroll_overlap(lineoff_T *lp, int dir)
/*
* Scroll 'scroll' lines up or down.
*/
-void halfpage(int flag, linenr_T Prenum)
+void halfpage(bool flag, linenr_T Prenum)
{
long scrolled = 0;
int i;
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 9fb096f7d2..291ae29793 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -992,8 +992,8 @@ getcount:
cursor_on();
out_flush();
if (msg_scroll || emsg_on_display)
- ui_delay(1000L, TRUE); /* wait at least one second */
- ui_delay(3000L, FALSE); /* wait up to three seconds */
+ ui_delay(1000L, true); /* wait at least one second */
+ ui_delay(3000L, false); /* wait up to three seconds */
State = save_State;
msg_scroll = FALSE;
@@ -6709,7 +6709,7 @@ static void nv_bck_word(cmdarg_T *cap)
static void nv_wordcmd(cmdarg_T *cap)
{
int n;
- int word_end;
+ bool word_end;
int flag = FALSE;
pos_T startpos = curwin->w_cursor;
@@ -6717,9 +6717,9 @@ static void nv_wordcmd(cmdarg_T *cap)
* Set inclusive for the "E" and "e" command.
*/
if (cap->cmdchar == 'e' || cap->cmdchar == 'E')
- word_end = TRUE;
+ word_end = true;
else
- word_end = FALSE;
+ word_end = false;
cap->oap->inclusive = word_end;
/*
@@ -6753,7 +6753,7 @@ static void nv_wordcmd(cmdarg_T *cap)
* flag.
*/
cap->oap->inclusive = TRUE;
- word_end = TRUE;
+ word_end = true;
flag = TRUE;
}
}
diff --git a/src/nvim/os_unix.c b/src/nvim/os_unix.c
index 01c2ef4164..e1b622081c 100644
--- a/src/nvim/os_unix.c
+++ b/src/nvim/os_unix.c
@@ -129,7 +129,7 @@ void mch_suspend()
long wait_time;
for (wait_time = 0; !sigcont_received && wait_time <= 3L; wait_time++)
/* Loop is not entered most of the time */
- os_delay(wait_time, FALSE);
+ os_delay(wait_time, false);
}
# endif
@@ -1186,7 +1186,7 @@ int mch_expand_wildcards(int num_pat, char_u **pat, int *num_file,
/* When running in the background, give it some time to create the temp
* file, but don't wait for it to finish. */
if (ampersent)
- os_delay(10L, TRUE);
+ os_delay(10L, true);
free(command);
diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c
index b0ed3047ae..4ff1132ab9 100644
--- a/src/nvim/popupmnu.c
+++ b/src/nvim/popupmnu.c
@@ -536,7 +536,7 @@ static int pum_set_selected(int n, int repeat)
if ((p_pvh > 0) && (p_pvh < g_do_tagpreview)) {
g_do_tagpreview = p_pvh;
}
- resized = prepare_tagpreview(FALSE);
+ resized = prepare_tagpreview(false);
g_do_tagpreview = 0;
if (curwin->w_p_pvw) {
@@ -612,7 +612,7 @@ static int pum_set_selected(int n, int repeat)
// the window when needed, otherwise it will always be
// redraw.
if (resized) {
- win_enter(curwin_save, TRUE);
+ win_enter(curwin_save, true);
update_topline();
}
@@ -623,7 +623,7 @@ static int pum_set_selected(int n, int repeat)
pum_do_redraw = FALSE;
if (!resized && win_valid(curwin_save)) {
- win_enter(curwin_save, TRUE);
+ win_enter(curwin_save, true);
}
// May need to update the screen again when there are
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 492ac1e606..1dda982c92 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1383,7 +1383,7 @@ void qf_jump(qf_info_T *qi, int dir, int errornr, int forceit)
if (wp->w_buffer != NULL && wp->w_buffer->b_help)
break;
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
- win_enter(wp, TRUE);
+ win_enter(wp, true);
else {
/*
* Split off help window; put it at far top if no position
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 67e00d6a27..0a33382a05 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -6080,7 +6080,7 @@ void check_for_delay(int check_msg_scroll)
&& !did_wait_return
&& emsg_silent == 0) {
out_flush();
- ui_delay(1000L, TRUE);
+ ui_delay(1000L, true);
emsg_on_display = FALSE;
if (check_msg_scroll)
msg_scroll = FALSE;
diff --git a/src/nvim/search.c b/src/nvim/search.c
index ee81f6c851..55d7c50a0b 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -2049,9 +2049,9 @@ showmatch (
* available.
*/
if (vim_strchr(p_cpo, CPO_SHOWMATCH) != NULL)
- ui_delay(p_mat * 100L, TRUE);
+ ui_delay(p_mat * 100L, true);
else if (!char_avail())
- ui_delay(p_mat * 100L, FALSE);
+ ui_delay(p_mat * 100L, false);
curwin->w_cursor = save_cursor; /* restore cursor position */
p_so = save_so;
p_siso = save_siso;
@@ -2183,7 +2183,7 @@ found:
*/
int
findpar (
- int *pincl, /* Return: TRUE if last char is to be included */
+ int *pincl, /* Return: TRUE if last char is to be included */
int dir,
long count,
int what,
@@ -4389,7 +4389,7 @@ search_line:
/* ":psearch" uses the preview window */
if (g_do_tagpreview != 0) {
curwin_save = curwin;
- prepare_tagpreview(TRUE);
+ prepare_tagpreview(true);
}
if (action == ACTION_SPLIT) {
if (win_split(0, 0) == FAIL)
@@ -4424,7 +4424,7 @@ search_line:
/* Return cursor to where we were */
validate_cursor();
redraw_later(VALID);
- win_enter(curwin_save, TRUE);
+ win_enter(curwin_save, true);
}
break;
}
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 0ce8d6e16f..0f29c8ffc8 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -7604,7 +7604,7 @@ static void highlight_list_two(int cnt, int attr)
msg_puts_attr((char_u *)&("N \bI \b! \b"[cnt / 11]), attr);
msg_clr_eos();
out_flush();
- ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, FALSE);
+ ui_delay(cnt == 99 ? 40L : (long)cnt * 50L, false);
}
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 8c873283f0..141c5ee98b 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -876,7 +876,7 @@ do_tag (
give_warning(IObuff, ic);
if (ic && !msg_scrolled && msg_silent == 0) {
out_flush();
- ui_delay(1000L, TRUE);
+ ui_delay(1000L, true);
}
}
@@ -2414,7 +2414,7 @@ jumpto_tag (
* Make the preview window the current window.
* Open a preview window when needed.
*/
- prepare_tagpreview(TRUE);
+ prepare_tagpreview(true);
}
}
@@ -2525,7 +2525,7 @@ jumpto_tag (
MSG(_("E435: Couldn't find tag, just guessing!"));
if (!msg_scrolled && msg_silent == 0) {
out_flush();
- ui_delay(1000L, TRUE);
+ ui_delay(1000L, true);
}
}
retval = OK;
@@ -2580,7 +2580,7 @@ jumpto_tag (
/* Return cursor to where we were */
validate_cursor();
redraw_later(VALID);
- win_enter(curwin_save, TRUE);
+ win_enter(curwin_save, true);
}
--RedrawingDisabled;
diff --git a/src/nvim/term.c b/src/nvim/term.c
index 664d8d962b..ecbd9da8e6 100644
--- a/src/nvim/term.c
+++ b/src/nvim/term.c
@@ -1455,7 +1455,7 @@ int set_termname(char_u *term)
if (emsg_silent == 0) {
screen_start(); /* don't know where cursor is now */
out_flush();
- ui_delay(2000L, TRUE);
+ ui_delay(2000L, true);
}
set_string_option_direct((char_u *)"term", -1, term,
OPT_FREE, 0);
@@ -2608,7 +2608,7 @@ void stoptermcap(void)
if (crv_status == CRV_SENT || u7_status == U7_SENT) {
# ifdef UNIX
/* Give the terminal a chance to respond. */
- os_delay(100L, FALSE);
+ os_delay(100L, false);
# endif
# ifdef TCIFLUSH
/* Discard data received but not read. */
diff --git a/src/nvim/ui.c b/src/nvim/ui.c
index 78b540e6a8..7c20f2582d 100644
--- a/src/nvim/ui.c
+++ b/src/nvim/ui.c
@@ -119,7 +119,7 @@ ui_inchar (
/* ... there is no need for CTRL-C to interrupt something, don't let
* it set got_int when it was mapped. */
if (mapped_ctrl_c)
- ctrl_c_interrupts = FALSE;
+ ctrl_c_interrupts = false;
}
#ifndef NO_CONSOLE
@@ -132,7 +132,7 @@ ui_inchar (
/* block SIGHUP et al. */
signal_reject_deadly();
- ctrl_c_interrupts = TRUE;
+ ctrl_c_interrupts = true;
#ifdef NO_CONSOLE_INPUT
theend:
@@ -162,7 +162,7 @@ int ui_char_avail(void)
* Delay for the given number of milliseconds. If ignoreinput is FALSE then we
* cancel the delay if a key is hit.
*/
-void ui_delay(long msec, int ignoreinput)
+void ui_delay(long msec, bool ignoreinput)
{
os_delay(msec, ignoreinput);
}
@@ -365,7 +365,7 @@ void trash_input_buf(void)
int read_from_input_buf(char_u *buf, long maxlen)
{
if (inbufcount == 0) /* if the buffer is empty, fill it */
- fill_input_buf(TRUE);
+ fill_input_buf(true);
if (maxlen > inbufcount)
maxlen = inbufcount;
memmove(buf, inbuf, (size_t)maxlen);
@@ -375,7 +375,7 @@ int read_from_input_buf(char_u *buf, long maxlen)
return (int)maxlen;
}
-void fill_input_buf(int exit_on_error)
+void fill_input_buf(bool exit_on_error)
{
#if defined(UNIX) || defined(MACOS_X_UNIX)
int len;
@@ -560,13 +560,13 @@ jump_to_mouse (
win_T *wp, *old_curwin;
pos_T old_cursor;
int count;
- int first;
+ bool first;
int row = mouse_row;
int col = mouse_col;
int mouse_char;
- mouse_past_bottom = FALSE;
- mouse_past_eol = FALSE;
+ mouse_past_bottom = false;
+ mouse_past_eol = false;
if (flags & MOUSE_RELEASED) {
/* On button release we may change window focus if positioned on a
@@ -669,7 +669,7 @@ retnomove:
* status line. Do change focus when releasing the mouse button
* (MOUSE_FOCUS was set above if we dragged first). */
if (dragwin == NULL || (flags & MOUSE_RELEASED))
- win_enter(wp, TRUE); /* can make wp invalid! */
+ win_enter(wp, true); /* can make wp invalid! */
# ifdef CHECK_DOUBLE_CLICK
/* set topline, to be able to check for double click ourselves */
if (curwin != old_curwin)
@@ -726,14 +726,14 @@ retnomove:
*/
if (row < 0) {
count = 0;
- for (first = TRUE; curwin->w_topline > 1; ) {
+ for (first = true; curwin->w_topline > 1; ) {
if (curwin->w_topfill < diff_check(curwin, curwin->w_topline))
++count;
else
count += plines(curwin->w_topline - 1);
if (!first && count > -row)
break;
- first = FALSE;
+ first = false;
hasFolding(curwin->w_topline, &curwin->w_topline, NULL);
if (curwin->w_topfill < diff_check(curwin, curwin->w_topline))
++curwin->w_topfill;
@@ -742,21 +742,21 @@ retnomove:
curwin->w_topfill = 0;
}
}
- check_topfill(curwin, FALSE);
+ check_topfill(curwin, false);
curwin->w_valid &=
~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
redraw_later(VALID);
row = 0;
} else if (row >= curwin->w_height) {
count = 0;
- for (first = TRUE; curwin->w_topline < curbuf->b_ml.ml_line_count; ) {
+ for (first = true; curwin->w_topline < curbuf->b_ml.ml_line_count; ) {
if (curwin->w_topfill > 0)
++count;
else
count += plines(curwin->w_topline);
if (!first && count > row - curwin->w_height + 1)
break;
- first = FALSE;
+ first = false;
if (hasFolding(curwin->w_topline, NULL, &curwin->w_topline)
&& curwin->w_topline == curbuf->b_ml.ml_line_count)
break;
@@ -768,7 +768,7 @@ retnomove:
diff_check_fill(curwin, curwin->w_topline);
}
}
- check_topfill(curwin, FALSE);
+ check_topfill(curwin, false);
redraw_later(VALID);
curwin->w_valid &=
~(VALID_WROW|VALID_CROW|VALID_BOTLINE|VALID_BOTLINE_AP);
@@ -795,7 +795,7 @@ retnomove:
/* compute the position in the buffer line from the posn on the screen */
if (mouse_comp_pos(curwin, &row, &col, &curwin->w_cursor.lnum))
- mouse_past_bottom = TRUE;
+ mouse_past_bottom = true;
/* Start Visual mode before coladvance(), for when 'sel' != "old" */
if ((flags & MOUSE_MAY_VIS) && !VIsual_active) {
@@ -815,7 +815,7 @@ retnomove:
if (coladvance(col) == FAIL) { /* Mouse click beyond end of line */
if (inclusive != NULL)
*inclusive = TRUE;
- mouse_past_eol = TRUE;
+ mouse_past_eol = true;
} else if (inclusive != NULL)
*inclusive = FALSE;
@@ -837,12 +837,12 @@ retnomove:
* window "win".
* Returns TRUE if the position is below the last line.
*/
-int mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump)
+bool mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump)
{
int col = *colp;
int row = *rowp;
linenr_T lnum;
- int retval = FALSE;
+ bool retval = false;
int off;
int count;
@@ -867,7 +867,7 @@ int mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump)
break; /* Position is in this buffer line. */
(void)hasFoldingWin(win, lnum, NULL, &lnum, TRUE, NULL);
if (lnum == win->w_buffer->b_ml.ml_line_count) {
- retval = TRUE;
+ retval = true;
break; /* past end of file */
}
row -= count;
diff --git a/src/nvim/window.c b/src/nvim/window.c
index 93440def39..994d576469 100644
--- a/src/nvim/window.c
+++ b/src/nvim/window.c
@@ -892,7 +892,7 @@ int win_split_ins(int size, int flags, win_T *new_wp, int dir)
/*
* make the new window the current window
*/
- win_enter(wp, FALSE);
+ win_enter(wp, false);
if (flags & WSP_VERT)
p_wiw = i;
else
@@ -1146,7 +1146,7 @@ static void win_exchange(long Prenum)
(void)win_comp_pos(); /* recompute window positions */
- win_enter(wp, TRUE);
+ win_enter(wp, true);
redraw_later(CLEAR);
}
@@ -1302,7 +1302,7 @@ void win_move_after(win_T *win1, win_T *win2)
(void)win_comp_pos(); /* recompute w_winrow for all windows */
redraw_later(NOT_VALID);
}
- win_enter(win1, FALSE);
+ win_enter(win1, false);
}
/*
@@ -1876,7 +1876,7 @@ int win_close(win_T *win, int free_buf)
else
win_comp_pos();
if (close_curwin) {
- win_enter_ext(wp, FALSE, TRUE, TRUE, TRUE);
+ win_enter_ext(wp, false, TRUE, TRUE, TRUE);
if (other_buffer)
/* careful: after this wp and win may be invalid! */
apply_autocmds(EVENT_BUFENTER, NULL, NULL, FALSE, curbuf);
@@ -3022,7 +3022,7 @@ static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, int trigger_enter_au
/* We would like doing the TabEnter event first, but we don't have a
* valid current window yet, which may break some commands.
* This triggers autocommands, thus may make "tp" invalid. */
- win_enter_ext(tp->tp_curwin, FALSE, TRUE,
+ win_enter_ext(tp->tp_curwin, false, TRUE,
trigger_enter_autocmds, trigger_leave_autocmds);
prevwin = next_prevwin;
@@ -3143,7 +3143,7 @@ void goto_tabpage_win(tabpage_T *tp, win_T *wp)
{
goto_tabpage_tp(tp, TRUE, TRUE);
if (curtab == tp && win_valid(wp)) {
- win_enter(wp, TRUE);
+ win_enter(wp, true);
}
}
@@ -3210,7 +3210,7 @@ void win_goto(win_T *wp)
else if (VIsual_active)
wp->w_cursor = curwin->w_cursor;
- win_enter(wp, TRUE);
+ win_enter(wp, true);
/* Conceal cursor line in previous window, unconceal in current window. */
if (win_valid(owp) && owp->w_p_cole > 0 && !msg_scrolled)
@@ -3357,7 +3357,7 @@ end:
/*
* Make window "wp" the current window.
*/
-void win_enter(win_T *wp, int undo_sync)
+void win_enter(win_T *wp, bool undo_sync)
{
win_enter_ext(wp, undo_sync, FALSE, TRUE, TRUE);
}
@@ -3367,7 +3367,7 @@ void win_enter(win_T *wp, int undo_sync)
* Can be called with "curwin_invalid" TRUE, which means that curwin has just
* been closed and isn't valid.
*/
-static void win_enter_ext(win_T *wp, int undo_sync, int curwin_invalid, int trigger_enter_autocmds, int trigger_leave_autocmds)
+static void win_enter_ext(win_T *wp, bool undo_sync, int curwin_invalid, int trigger_enter_autocmds, int trigger_leave_autocmds)
{
int other_buffer = FALSE;
@@ -3471,7 +3471,7 @@ win_T *buf_jump_open_win(buf_T *buf)
if (wp->w_buffer == buf)
break;
if (wp != NULL)
- win_enter(wp, FALSE);
+ win_enter(wp, false);
return wp;
}