diff options
| author | James McCoy <jamessan@jamessan.com> | 2017-02-02 12:45:02 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-02 12:45:02 -0500 | 
| commit | e8899178ec34e8432fc2e63f2970b0962e72c74c (patch) | |
| tree | c8b464c7b7aa3f7026decae1c37f8cd379325e77 /src | |
| parent | 05081927744f1942dbe49b17dd58e7c3d5f57916 (diff) | |
| parent | e0e4825897cdfcd2d125240321ec2980a40f7951 (diff) | |
| download | rneovim-e8899178ec34e8432fc2e63f2970b0962e72c74c.tar.gz rneovim-e8899178ec34e8432fc2e63f2970b0962e72c74c.tar.bz2 rneovim-e8899178ec34e8432fc2e63f2970b0962e72c74c.zip | |
Merge pull request #5869 from hardenedapple/undojoin-curhead
Don't set `b_u_curhead` in `ex_undojoin()`
Diffstat (limited to 'src')
| -rw-r--r-- | src/nvim/undo.c | 20 | 
1 files changed, 10 insertions, 10 deletions
| diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 129308ad3e..4b267a1627 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -2551,20 +2551,20 @@ static void u_add_time(char_u *buf, size_t buflen, time_t tt)   */  void ex_undojoin(exarg_T *eap)  { -  if (curbuf->b_u_newhead == NULL) -    return;                 /* nothing changed before */ +  if (curbuf->b_u_newhead == NULL) { +    return;                 // nothing changed before +  }    if (curbuf->b_u_curhead != NULL) {      EMSG(_("E790: undojoin is not allowed after undo"));      return;    } -  if (!curbuf->b_u_synced) -    return;                 /* already unsynced */ -  if (get_undolevel() < 0) -    return;                 /* no entries, nothing to do */ -  else { -    /* Go back to the last entry */ -    curbuf->b_u_curhead = curbuf->b_u_newhead; -    curbuf->b_u_synced = false;      /* no entries, nothing to do */ +  if (!curbuf->b_u_synced) { +    return;                 // already unsynced +  } +  if (get_undolevel() < 0) { +    return;                 // no entries, nothing to do +  } else { +    curbuf->b_u_synced = false;  // Append next change to last entry    }  } | 
