diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2018-08-08 02:22:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-08 02:22:34 +0200 |
| commit | b7a417c5e6b510a0023e544463edd6feef30f9d2 (patch) | |
| tree | ee335ecbd0542a81a3cae584a4165dc0620131d6 /src/nvim/undo.c | |
| parent | c06613d2f6c3f3a864c43e03b95d12efb3e0f4a6 (diff) | |
| parent | d5e8b3f451120d7b40d72b54d749fbe7b54ca90f (diff) | |
| download | rneovim-b7a417c5e6b510a0023e544463edd6feef30f9d2.tar.gz rneovim-b7a417c5e6b510a0023e544463edd6feef30f9d2.tar.bz2 rneovim-b7a417c5e6b510a0023e544463edd6feef30f9d2.zip | |
Merge #8744 from janlazo/vim-8.0.0890
Diffstat (limited to 'src/nvim/undo.c')
| -rw-r--r-- | src/nvim/undo.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 2055b4879e..f4eb50b3b5 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -2233,10 +2233,11 @@ static void u_undoredo(int undo, bool do_buf_event) * If the file is empty, there is an empty line 1 that we * should get rid of, by replacing it with the new line */ - if (empty_buffer && lnum == 0) - ml_replace((linenr_T)1, uep->ue_array[i], TRUE); - else + if (empty_buffer && lnum == 0) { + ml_replace((linenr_T)1, uep->ue_array[i], true); + } else { ml_append(lnum, uep->ue_array[i], (colnr_T)0, FALSE); + } xfree(uep->ue_array[i]); } xfree((char_u *)uep->ue_array); @@ -2902,7 +2903,7 @@ void u_undoline(void) curbuf->b_u_line_lnum + 1, (linenr_T)0, FALSE) == FAIL) return; oldp = u_save_line(curbuf->b_u_line_lnum); - ml_replace(curbuf->b_u_line_lnum, curbuf->b_u_line_ptr, TRUE); + ml_replace(curbuf->b_u_line_lnum, curbuf->b_u_line_ptr, true); changed_bytes(curbuf->b_u_line_lnum, 0); xfree(curbuf->b_u_line_ptr); curbuf->b_u_line_ptr = oldp; |
