From d5a1d88e92791e7a7d71f00e1f9fce961833278f Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Thu, 29 Feb 2024 00:49:31 +0100 Subject: [PATCH] Check if visual selection from '<'> is not empty Signed-off-by: Tomas Slusny --- lua/CopilotChat/select.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/CopilotChat/select.lua b/lua/CopilotChat/select.lua index 711186ad..1f60bdfd 100644 --- a/lua/CopilotChat/select.lua +++ b/lua/CopilotChat/select.lua @@ -64,6 +64,11 @@ function M.visual() if start[2] == finish[2] and start[3] == finish[3] then start = vim.fn.getpos("'<") finish = vim.fn.getpos("'>") + + if start[2] == finish[2] and start[3] == finish[3] then + return nil + end + mode = 'v' else -- Exit visual mode