diff options
| author | bfredl <bjorn.linse@gmail.com> | 2023-08-27 13:56:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-27 13:56:20 +0200 |
| commit | 4c69279f97e566277a33b81146b26b7ca20de4f3 (patch) | |
| tree | e9ed01feacbc4be34b96faf46e4baa1a8c83de16 /src/nvim/undo.c | |
| parent | b7d5b55f74fd589dee27d8356d45b31c552705c3 (diff) | |
| parent | 840749d6c971f93aa9744bd6f76b383f11043463 (diff) | |
| download | rneovim-4c69279f97e566277a33b81146b26b7ca20de4f3.tar.gz rneovim-4c69279f97e566277a33b81146b26b7ca20de4f3.tar.bz2 rneovim-4c69279f97e566277a33b81146b26b7ca20de4f3.zip | |
Merge pull request #24889 from bfredl/topline
fix(api): fix issues with nvim_buf_set_lines refactor
Diffstat (limited to 'src/nvim/undo.c')
| -rw-r--r-- | src/nvim/undo.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 552120d4ae..1194eeca35 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -3208,15 +3208,13 @@ u_header_T *u_force_get_undo_header(buf_T *buf) } // Create the first undo header for the buffer if (!uhp) { - // Undo is normally invoked in change code, which already has swapped - // curbuf. // Args are tricky: this means replace empty range by empty range.. - u_savecommon(curbuf, 0, 1, 1, true); + u_savecommon(buf, 0, 1, 1, true); uhp = buf->b_u_curhead; if (!uhp) { uhp = buf->b_u_newhead; - if (get_undolevel(curbuf) > 0 && !uhp) { + if (get_undolevel(buf) > 0 && !uhp) { abort(); } } |