From 9dad07841375153f1c66b8a85d70a99c30803cbb Mon Sep 17 00:00:00 2001 From: robin Date: Tue, 3 Feb 2026 16:06:33 +0100 Subject: [PATCH] fix(utils): match mode based on *first* character with `^` pattern --- lua/lylla/utils.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/lylla/utils.lua b/lua/lylla/utils.lua index c5ad22d..ed73173 100644 --- a/lua/lylla/utils.lua +++ b/lua/lylla/utils.lua @@ -121,19 +121,19 @@ end function utils.get_modehl() local mode = vim.api.nvim_get_mode().mode - if string.match(mode, "n") then + if string.match(mode, "^n") then return utils.get_modehl_name("normal") end - if string.match(mode, "[vVs]") then + if string.match(mode, "^[vVs]") then return utils.get_modehl_name("visual") end - if string.match(mode, "c") then + if string.match(mode, "^c") then return utils.get_modehl_name("command") end - if string.match(mode, "[irRt]") then + if string.match(mode, "^[irRt]") then return utils.get_modehl_name("insert") end -- 2.51.2