From 331bb16250865e267a624569f7a085f4a4b4a5a1 Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Thu, 2 Nov 2023 02:19:59 +0100 Subject: [PATCH] fix: stops at numbers in camelCase (#31) --- lua/spider.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lua/spider.lua b/lua/spider.lua index 158c222..c9b00e5 100644 --- a/lua/spider.lua +++ b/lua/spider.lua @@ -75,8 +75,9 @@ end local function getNextPosition(line, col, key, opts) -- `%f[set]` is roughly lua's equivalent of `\b` local patterns = { - lowerWord = "%u?[%l%d]+", -- first char may be uppercase for CamelCase - upperWord = "%f[%w][%u%d]+%f[^%w]", -- solely uppercase for SCREAMING_SNAKE_CASE + lowerWord = "%u?[%l]+", -- first char may be uppercase for CamelCase + upperWord = "%f[%w][%u]+%f[^%w]", -- solely uppercase for SCREAMING_SNAKE_CASE + number = "%d+", -- see issue #31 divisibleBy10Test punctuation = "%f[^%s]%p+%f[%s]", -- punctuation surrounded by whitespace punctAtStart = "^%p+%f[%s]", -- needed since lua does not allow for logical OR punctAtEnd = "%f[^%s]%p+$",