summaryrefslogtreecommitdiff
path: root/src/ops.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-06-27 20:49:44 +0200
committerBram Moolenaar <Bram@vim.org>2018-06-27 20:49:44 +0200
commitf52f9ea8f5fb3df51a308c56f2bf66f735ef3ca7 (patch)
tree28df043ec3739ec82a80cef96605de5a91e6ba11 /src/ops.c
parentbd87eb38c558521ff709651ac190ffd1b9dee057 (diff)
downloadvim-git-f52f9ea8f5fb3df51a308c56f2bf66f735ef3ca7.tar.gz
patch 8.1.0118: duplicate error message for put commandv8.1.0118
Problem: Duplicate error message for put command. Solution: Check return value of u_save(). (Jason Franklin)
Diffstat (limited to 'src/ops.c')
-rw-r--r--src/ops.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ops.c b/src/ops.c
index 2dbc74889..73f73d2f9 100644
--- a/src/ops.c
+++ b/src/ops.c
@@ -3551,9 +3551,10 @@ do_put(
return;
}
- /* Autocommands may be executed when saving lines for undo, which may make
- * y_array invalid. Start undo now to avoid that. */
- u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1);
+ /* Autocommands may be executed when saving lines for undo. This might
+ * make "y_array" invalid, so we start undo now to avoid that. */
+ if (u_save(curwin->w_cursor.lnum, curwin->w_cursor.lnum + 1) == FAIL)
+ goto end;
if (insert_string != NULL)
{