From 55a2c513aafb386c01259fca711b2e0f9b85e359 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Wed, 16 Sep 2020 22:57:34 +0200 Subject: buffer: don't rely on curbuf in BUFEMPTY --- src/nvim/ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/ops.c') diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 855f63ba7b..545ab8a94a 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -3069,7 +3069,7 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) } // In an empty buffer the empty line is going to be replaced, include // it in the saved lines. - if ((BUFEMPTY() ? u_save(0, 2) : u_save(lnum - 1, lnum)) == FAIL) { + if ((BUFEMPTY(curbuf) ? u_save(0, 2) : u_save(lnum - 1, lnum)) == FAIL) { goto end; } if (dir == FORWARD) { -- cgit From 7970631fa01e95a41ba4520e030e6208c8fb3648 Mon Sep 17 00:00:00 2001 From: Thomas Vigouroux Date: Tue, 24 Nov 2020 08:48:05 +0100 Subject: buffer: move BUFEMPTY to a function --- src/nvim/ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/ops.c') diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 545ab8a94a..79e701d7d8 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -3069,7 +3069,8 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags) } // In an empty buffer the empty line is going to be replaced, include // it in the saved lines. - if ((BUFEMPTY(curbuf) ? u_save(0, 2) : u_save(lnum - 1, lnum)) == FAIL) { + if ((buf_is_empty(curbuf) ? + u_save(0, 2) : u_save(lnum - 1, lnum)) == FAIL) { goto end; } if (dir == FORWARD) { -- cgit