aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/undo.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-04-30 12:24:56 +0200
committerGitHub <noreply@github.com>2019-04-30 12:24:56 +0200
commit8342b4486b43e6664b6412ac0c8a549097220df2 (patch)
tree7b892b17acbcac5e8298b641e336ee7de05647dd /src/nvim/undo.c
parent63526f2eeee774c657270a1ec0cbd788480f14b7 (diff)
parent0e7048ae0558e457d37ce2d13dc5f1f9e62deb49 (diff)
downloadrneovim-8342b4486b43e6664b6412ac0c8a549097220df2.tar.gz
rneovim-8342b4486b43e6664b6412ac0c8a549097220df2.tar.bz2
rneovim-8342b4486b43e6664b6412ac0c8a549097220df2.zip
Merge #9957 from janlazo/vim-8.0.1263
vim-patch:8.0.{1263,1265,1267}
Diffstat (limited to 'src/nvim/undo.c')
-rw-r--r--src/nvim/undo.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index f5ee0ece8d..10996d99d5 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -2151,7 +2151,7 @@ static void u_undoredo(int undo, bool do_buf_event)
int new_flags;
fmark_T namedm[NMARKS];
visualinfo_T visualinfo;
- int empty_buffer; /* buffer became empty */
+ bool empty_buffer; // buffer became empty
u_header_T *curhead = curbuf->b_u_curhead;
/* Don't want autocommands using the undo structures here, they are
@@ -2218,7 +2218,7 @@ static void u_undoredo(int undo, bool do_buf_event)
}
}
- empty_buffer = FALSE;
+ empty_buffer = false;
/* delete the lines between top and bot and save them in newarray */
if (oldsize > 0) {
@@ -2229,9 +2229,10 @@ static void u_undoredo(int undo, bool do_buf_event)
newarray[i] = u_save_line(lnum);
/* remember we deleted the last line in the buffer, and a
* dummy empty line will be inserted */
- if (curbuf->b_ml.ml_line_count == 1)
- empty_buffer = TRUE;
- ml_delete(lnum, FALSE);
+ if (curbuf->b_ml.ml_line_count == 1) {
+ empty_buffer = true;
+ }
+ ml_delete(lnum, false);
}
} else
newarray = NULL;
@@ -2246,7 +2247,7 @@ static void u_undoredo(int undo, bool do_buf_event)
if (empty_buffer && lnum == 0) {
ml_replace((linenr_T)1, uep->ue_array[i], true);
} else {
- ml_append(lnum, uep->ue_array[i], (colnr_T)0, FALSE);
+ ml_append(lnum, uep->ue_array[i], (colnr_T)0, false);
}
xfree(uep->ue_array[i]);
}