aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-20 21:51:01 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-08-20 23:49:34 -0400
commitee51061b8c00eb1ac8ce628ba3831236b327ead2 (patch)
treedfa69226bc99fb4807a74fddb1237a595e3b23a8
parent612f3fd57a94ce9674650a973f6bc7a5dfed1949 (diff)
downloadrneovim-ee51061b8c00eb1ac8ce628ba3831236b327ead2.tar.gz
rneovim-ee51061b8c00eb1ac8ce628ba3831236b327ead2.tar.bz2
rneovim-ee51061b8c00eb1ac8ce628ba3831236b327ead2.zip
lint
-rw-r--r--src/nvim/ex_docmd.c7
-rw-r--r--src/nvim/undo.c25
2 files changed, 18 insertions, 14 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index b40cf3d3f7..b22f799da0 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -7577,10 +7577,11 @@ static void ex_bang(exarg_T *eap)
*/
static void ex_undo(exarg_T *eap)
{
- if (eap->addr_count == 1) /* :undo 123 */
+ if (eap->addr_count == 1) { // :undo 123
undo_time(eap->line2, false, false, true);
- else
+ } else {
u_undo(1);
+ }
}
static void ex_wundo(exarg_T *eap)
@@ -7634,7 +7635,7 @@ static void ex_later(exarg_T *eap)
EMSG2(_(e_invarg2), eap->arg);
else
undo_time(eap->cmdidx == CMD_earlier ? -count : count,
- sec, file, false);
+ sec, file, false);
}
/*
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 6982e440c5..e15b9ec796 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -1675,10 +1675,11 @@ void u_undo(int count)
count = 1;
}
- if (vim_strchr(p_cpo, CPO_UNDO) == NULL)
+ if (vim_strchr(p_cpo, CPO_UNDO) == NULL) {
undo_undoes = true;
- else
+ } else {
undo_undoes = !undo_undoes;
+ }
u_doit(count, false, true);
}
@@ -2020,11 +2021,9 @@ void undo_time(long step, bool sec, bool file, bool absolute)
}
found:
- /* If we found it: Follow the path to go to where we want to be. */
+ // If we found it: Follow the path to go to where we want to be.
if (uhp != NULL || target == 0) {
- /*
- * First go up the tree as much as needed.
- */
+ // First go up the tree as much as needed.
while (!got_int) {
/* Do the change warning now, for the same reason as above. */
change_warning(0);
@@ -2034,9 +2033,11 @@ found:
uhp = curbuf->b_u_newhead;
else
uhp = uhp->uh_next.ptr;
- if (uhp == NULL || (target > 0 && uhp->uh_walk != mark)
- || (uhp->uh_seq == target && !above))
+ if (uhp == NULL
+ || (target > 0 && uhp->uh_walk != mark)
+ || (uhp->uh_seq == target && !above)) {
break;
+ }
curbuf->b_u_curhead = uhp;
u_undoredo(true, true);
if (target > 0) {
@@ -2428,12 +2429,14 @@ static void u_undo_end(
if (absolute && curbuf->b_u_curhead->uh_next.ptr != NULL) {
uhp = curbuf->b_u_curhead->uh_next.ptr;
did_undo = false;
- } else if (did_undo)
+ } else if (did_undo) {
uhp = curbuf->b_u_curhead;
- else
+ } else {
uhp = curbuf->b_u_curhead->uh_next.ptr;
- } else
+ }
+ } else {
uhp = curbuf->b_u_newhead;
+ }
if (uhp == NULL)
*msgbuf = NUL;