From 9269eee3d574e29fca59ea1c5dd87cf230d97267 Mon Sep 17 00:00:00 2001 From: glepnir Date: Thu, 16 May 2024 17:53:09 +0800 Subject: [PATCH] fix wrong valid word --- lua/epo/init.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/epo/init.lua b/lua/epo/init.lua index 9b680ef..f48f6c0 100644 --- a/lua/epo/init.lua +++ b/lua/epo/init.lua @@ -72,8 +72,9 @@ local function make_valid_word(str_arg) if valid == nil or valid == '' then return str end - if string.match(valid, ':$') then - return string.sub(valid, 1, -3) + local spos = valid:find('%$') + if spos then + return string.sub(valid, 1, spos - 1) end return valid end