tvi: do not update xoff for put command with an empty buffer - neatvi - [fork] simple vi-type editor with UTF-8 support
(HTM) git clone git://src.adamsgaard.dk/neatvi
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) commit 4e18f428ca3d31fbba8f0cd92ac71dda85a73422
(DIR) parent b5be802171251c906511c385f3e01520f420e740
(HTM) Author: Ali Gholami Rudi <ali@rudi.ir>
Date: Mon, 13 Sep 2021 16:55:36 +0430
vi: do not update xoff for put command with an empty buffer
Diffstat:
M vi.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/vi.c b/vi.c
t@@ -868,10 +868,10 @@ static int vc_put(int cmd)
int lnmode;
char *buf = reg_get(vi_ybuf, &lnmode);
int i;
- if (!buf) {
+ if (!buf)
snprintf(vi_msg, sizeof(vi_msg), "yank buffer empty\n");
+ if (!buf || !buf[0])
return 1;
- }
if (lnmode) {
struct sbuf *sb = sbuf_make();
for (i = 0; i < cnt; i++)