Skip to content

Commit

Permalink
fix(chainMember): greedily include call-part
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisgrieser committed Dec 26, 2024
1 parent 3d1e08d commit a357d3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/various-textobjs/textobjs/charwise.lua
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,11 @@ end

---@param scope "inner"|"outer" inner excludes the leading dot
function M.chainMember(scope)
-- make without-call lose ties, so call is always included
local patterns = {
leadingWithoutCall = "()[%w_][%w_]*([:.])",
tieloser_leadingWithoutCall = "()[%w_][%w_]*([:.])",
leadingWithCall = "()[%w_][%w_]*%b()([:.])",
followingWithoutCall = "([:.])[%w_][%w_]*()",
tieloser_followingWithoutCall = "([:.])[%w_][%w_]*()",
followingWithCall = "([:.])[%w_][%w_]*%b()()",
}
core.selectClosestTextobj(patterns, scope, smallForward())
Expand Down

0 comments on commit a357d3e

Please sign in to comment.