aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/misc1.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-07 12:32:13 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-07 13:11:51 -0400
commit672449e448e504b0ee1e4f1fea13932c90ae8211 (patch)
tree4eecbebfc5491a63e9e1783e52ff220fad77d2f0 /src/nvim/misc1.c
parent80df0a8fd23f4b51792e6f4a5f373b3aca1437c8 (diff)
downloadrneovim-672449e448e504b0ee1e4f1fea13932c90ae8211.tar.gz
rneovim-672449e448e504b0ee1e4f1fea13932c90ae8211.tar.bz2
rneovim-672449e448e504b0ee1e4f1fea13932c90ae8211.zip
memline: copy in ml_replace() is bool
Diffstat (limited to 'src/nvim/misc1.c')
-rw-r--r--src/nvim/misc1.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c
index d2ecb9a74b..a312783c64 100644
--- a/src/nvim/misc1.c
+++ b/src/nvim/misc1.c
@@ -772,7 +772,7 @@ open_line (
(void)u_save_cursor(); /* errors are ignored! */
vr_lines_changed++;
}
- ml_replace(curwin->w_cursor.lnum, p_extra, TRUE);
+ ml_replace(curwin->w_cursor.lnum, p_extra, true);
changed_bytes(curwin->w_cursor.lnum, 0);
curwin->w_cursor.lnum--;
did_append = FALSE;
@@ -832,12 +832,13 @@ open_line (
if (dir == FORWARD) {
if (trunc_line || (State & INSERT)) {
- /* truncate current line at cursor */
+ // truncate current line at cursor
saved_line[curwin->w_cursor.col] = NUL;
- /* Remove trailing white space, unless OPENLINE_KEEPTRAIL used. */
- if (trunc_line && !(flags & OPENLINE_KEEPTRAIL))
+ // Remove trailing white space, unless OPENLINE_KEEPTRAIL used.
+ if (trunc_line && !(flags & OPENLINE_KEEPTRAIL)) {
truncate_spaces(saved_line);
- ml_replace(curwin->w_cursor.lnum, saved_line, FALSE);
+ }
+ ml_replace(curwin->w_cursor.lnum, saved_line, false);
saved_line = NULL;
if (did_append) {
changed_lines(curwin->w_cursor.lnum, curwin->w_cursor.col,
@@ -913,8 +914,8 @@ open_line (
/* Put new line in p_extra */
p_extra = vim_strsave(get_cursor_line_ptr());
- /* Put back original line */
- ml_replace(curwin->w_cursor.lnum, next_line, FALSE);
+ // Put back original line
+ ml_replace(curwin->w_cursor.lnum, next_line, false);
/* Insert new stuff into line again */
curwin->w_cursor.col = 0;
@@ -1498,8 +1499,8 @@ void ins_char_bytes(char_u *buf, size_t charlen)
p[i] = ' ';
}
- /* Replace the line in the buffer. */
- ml_replace(lnum, newp, FALSE);
+ // Replace the line in the buffer.
+ ml_replace(lnum, newp, false);
// mark the buffer as changed and prepare for displaying
changed_bytes(lnum, (colnr_T)col);
@@ -1549,7 +1550,7 @@ void ins_str(char_u *s)
memmove(newp, oldp, (size_t)col);
memmove(newp + col, s, (size_t)newlen);
memmove(newp + col + newlen, oldp + col, (size_t)(oldlen - col + 1));
- ml_replace(lnum, newp, FALSE);
+ ml_replace(lnum, newp, false);
changed_bytes(lnum, col);
curwin->w_cursor.col += newlen;
}
@@ -1667,8 +1668,9 @@ int del_bytes(colnr_T count, bool fixpos_arg, bool use_delcombine)
memmove(newp, oldp, (size_t)col);
}
memmove(newp + col, oldp + col + count, (size_t)movelen);
- if (!was_alloced)
- ml_replace(lnum, newp, FALSE);
+ if (!was_alloced) {
+ ml_replace(lnum, newp, false);
+ }
/* mark the buffer as changed and prepare for displaying */
changed_bytes(lnum, curwin->w_cursor.col);