Mercurial > vim
diff src/ops.c @ 5053:35b6fc57a286 v7.3.1270
updated for version 7.3.1270
Problem: Using "Vp" in an empty buffer can't be undone. (Hauke Petersen)
Solution: Save one line in an empty buffer. (Christian Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sat, 29 Jun 2013 17:19:28 +0200 |
parents | 04736b4030ec |
children | 18b43970fb7a |
line wrap: on
line diff
--- a/src/ops.c +++ b/src/ops.c @@ -3497,7 +3497,9 @@ do_put(regname, dir, count, flags) #endif if (dir == FORWARD) ++lnum; - if (u_save(lnum - 1, lnum) == FAIL) + /* In an empty buffer the empty line is going to be replaced, include + * it in the saved lines. */ + if ((bufempty() ? u_save(0, 1) : u_save(lnum - 1, lnum)) == FAIL) goto end; #ifdef FEAT_FOLDING if (dir == FORWARD)