aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/undo.c
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2020-09-23 10:55:13 +0900
committererw7 <erw7.github@gmail.com>2020-10-02 11:41:30 +0900
commitb2f9c2b6c19ce9b66bf278b487d3fe59bf26304f (patch)
tree293c157d8754a43a26edc4826d2e787f4fbd8268 /src/nvim/undo.c
parent620c8fdfe91a382982fafaa376acd722fe0df051 (diff)
downloadrneovim-b2f9c2b6c19ce9b66bf278b487d3fe59bf26304f.tar.gz
rneovim-b2f9c2b6c19ce9b66bf278b487d3fe59bf26304f.tar.bz2
rneovim-b2f9c2b6c19ce9b66bf278b487d3fe59bf26304f.zip
undo: fix possibility of aborting
Diffstat (limited to 'src/nvim/undo.c')
-rw-r--r--src/nvim/undo.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 97018f6c02..903e57732f 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -3029,8 +3029,6 @@ u_header_T *u_force_get_undo_header(buf_T *buf)
curbuf = buf;
// Args are tricky: this means replace empty range by empty range..
u_savecommon(0, 1, 1, true);
- curbuf = save_curbuf;
-
uhp = buf->b_u_curhead;
if (!uhp) {
uhp = buf->b_u_newhead;
@@ -3038,6 +3036,7 @@ u_header_T *u_force_get_undo_header(buf_T *buf)
abort();
}
}
+ curbuf = save_curbuf;
}
return uhp;
}