aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/undo.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-11-09 12:41:50 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2019-11-11 20:18:15 +0100
commit18a8b702c0ce7a8bacd84f6c95e440ae23a3299e (patch)
treecd3bbe1bfe009ce75633793b028da2ce0ed35ef2 /src/nvim/undo.c
parenta9065a50518ef59351f9d0d32041a991a751653f (diff)
downloadrneovim-18a8b702c0ce7a8bacd84f6c95e440ae23a3299e.tar.gz
rneovim-18a8b702c0ce7a8bacd84f6c95e440ae23a3299e.tar.bz2
rneovim-18a8b702c0ce7a8bacd84f6c95e440ae23a3299e.zip
extmark: review changes
Diffstat (limited to 'src/nvim/undo.c')
-rw-r--r--src/nvim/undo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c
index 91a142214b..b00d2d505f 100644
--- a/src/nvim/undo.c
+++ b/src/nvim/undo.c
@@ -2849,7 +2849,6 @@ u_freeentries(
u_freeentry(uep, uep->ue_size);
}
- // TODO(timeyyy): is this the correct place? ...
kv_destroy(uhp->uh_extmark);
#ifdef U_DEBUG
@@ -3049,7 +3048,7 @@ list_T *u_eval_tree(const u_header_T *const first_uhp)
// Given the buffer, Return the undo header. If none is set, set one first.
// NULL will be returned if e.g undolevels = -1 (undo disabled)
-u_header_T *force_get_undo_header(buf_T *buf)
+u_header_T *u_force_get_undo_header(buf_T *buf)
{
u_header_T *uhp = NULL;
if (buf->b_u_curhead != NULL) {
@@ -3064,8 +3063,8 @@ u_header_T *force_get_undo_header(buf_T *buf)
uhp = buf->b_u_curhead;
if (!uhp) {
uhp = buf->b_u_newhead;
- if (get_undolevel() > 0) {
- assert(uhp);
+ if (get_undolevel() > 0 && !uhp) {
+ abort();
}
}
}