From 6094c7b7b8dcb18051072cdf9de2e370e830ea3c Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 28 Sep 2024 18:15:23 +0200 Subject: [PATCH] fix: extend 0-width cursors --- lua/codemp/workspace.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/codemp/workspace.lua b/lua/codemp/workspace.lua index 27b89f1..84ce94d 100644 --- a/lua/codemp/workspace.lua +++ b/lua/codemp/workspace.lua @@ -100,6 +100,10 @@ local function register_cursor_handler(controller) local buffer_id = buffers.map_rev[event.buffer] if buffer_id ~= nil then local hi = user_hl[event.user].hi + if event.start[1] == event.finish[1] and event.start[2] == event.finish[2] then + -- vim can't draw 0-width cursors, so we always expand them to at least 1 width + event.finish[2] = event.finish[2] + 1 + end user_hl[event.user].mark = vim.api.nvim_buf_set_extmark( buffer_id, user_hl[event.user].ns,