From f7e23bd39c7e65fcc4c9b19b05d030daa77d9b2e Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Tue, 3 Dec 2024 22:30:57 +0100 Subject: [PATCH] fix(subword): leading `_-` being selected for inner variant --- lua/various-textobjs/charwise-textobjs.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/various-textobjs/charwise-textobjs.lua b/lua/various-textobjs/charwise-textobjs.lua index 68365e7..14fda11 100644 --- a/lua/various-textobjs/charwise-textobjs.lua +++ b/lua/various-textobjs/charwise-textobjs.lua @@ -162,7 +162,7 @@ function M.subword(scope) -- the selection (see #83). local charBefore = line:sub(startCol - 1, startCol - 1) local charAtEnd = line:sub(endCol, endCol) - if not charAtEnd:find("[_-]") and charBefore:find("[_-]") then + if scope == "outer" and charBefore:find("[_-]") and not charAtEnd:find("[_-]") then -- `o`: to start of sel, `h`: select char before `o`: back to end of selection u.normal("oho") end