From 34f3fe9660b912429279ba87ab49aa3d0c37e0c9 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Sun, 8 Sep 2024 07:39:32 +0000 Subject: [PATCH] fix: force delete scratch buffer --- lua/rest-nvim/utils.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/rest-nvim/utils.lua b/lua/rest-nvim/utils.lua index 7583fc1..e406193 100644 --- a/lua/rest-nvim/utils.lua +++ b/lua/rest-nvim/utils.lua @@ -325,7 +325,9 @@ function utils.gq_lines(lines, filetype) vim.api.nvim_buf_call(format_buf, function() vim.cmd("silent normal gggqG") end) - return vim.api.nvim_buf_get_lines(format_buf, 0, -1, false), true + local buf_lines = vim.api.nvim_buf_get_lines(format_buf, 0, -1, false) + vim.api.nvim_buf_delete(format_buf, { force = true }) + return buf_lines, true end return utils