aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--runtime/lua/vim/re.lua15
2 files changed, 12 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6964ce79a9..dd8b2bf856 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -346,7 +346,10 @@ ExternalProject_Add(download_luals
file(GLOB_RECURSE LUAFILES runtime/*.lua)
add_target(luals
- COMMAND ${DEPS_BIN_DIR}/luals/bin/lua-language-server --configpath=${PROJECT_SOURCE_DIR}/.luarc.json --check=${PROJECT_SOURCE_DIR}/runtime
+ COMMAND ${DEPS_BIN_DIR}/luals/bin/lua-language-server
+ --configpath=${PROJECT_SOURCE_DIR}/.luarc.json
+ --check=${PROJECT_SOURCE_DIR}/runtime
+ --checklevel=Hint
DEPENDS ${LUAFILES}
CUSTOM_COMMAND_ARGS USES_TERMINAL)
diff --git a/runtime/lua/vim/re.lua b/runtime/lua/vim/re.lua
index e0a36703e3..5677230946 100644
--- a/runtime/lua/vim/re.lua
+++ b/runtime/lua/vim/re.lua
@@ -7,7 +7,7 @@
--- documentation available at runtime/lua/vim/_meta/re.lua
-- imported functions and modules
-local tonumber, type, print, error = tonumber, type, print, error
+local tonumber, type, error = tonumber, type, error
local setmetatable = setmetatable
local m = require"lpeg"
@@ -63,10 +63,10 @@ local function updatelocale ()
mem = {} -- restart memoization
fmem = {}
gmem = {}
- local mt = {__mode = "v"}
- setmetatable(mem, mt)
- setmetatable(fmem, mt)
- setmetatable(gmem, mt)
+ local mt0 = {__mode = "v"}
+ setmetatable(mem, mt0)
+ setmetatable(fmem, mt0)
+ setmetatable(gmem, mt0)
end
@@ -74,7 +74,7 @@ updatelocale()
-local I = m.P(function (s,i) print(i, s:sub(1, i-1)); return i end)
+-- local I = m.P(function (s,i) print(i, s:sub(1, i-1)); return i end)
local function patt_error (s, i)
@@ -240,7 +240,8 @@ local function find (s, p, i)
cp = mm.P{ mm.Cp() * cp * mm.Cp() + 1 * mm.V(1) }
fmem[p] = cp
end
- local i, e = cp:match(s, i or 1)
+ local e
+ i, e = cp:match(s, i or 1)
if i then return i, e - 1
else return i
end