aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSameed Ali <sameedali94@gmail.com>2019-04-14 16:56:11 -0400
committerDaniel Hahler <git@thequod.de>2019-07-04 06:59:44 +0200
commit571b2c5e7be105d23ada987a7c7080f8631bfd15 (patch)
tree0c07e601c2f1e55525f81a5804a5ec992adaeef0
parent99b870d61c0a574011d16886d2cea44d18c11a2d (diff)
downloadrneovim-571b2c5e7be105d23ada987a7c7080f8631bfd15.tar.gz
rneovim-571b2c5e7be105d23ada987a7c7080f8631bfd15.tar.bz2
rneovim-571b2c5e7be105d23ada987a7c7080f8631bfd15.zip
Fix luacheck errors for all Lua source files
-rw-r--r--src/nvim/generators/c_grammar.lua2
-rw-r--r--src/nvim/generators/gen_api_dispatch.lua83
-rw-r--r--src/nvim/generators/gen_api_ui_events.lua39
-rw-r--r--src/nvim/generators/gen_char_blob.lua11
-rwxr-xr-xsrc/nvim/generators/gen_declarations.lua11
-rw-r--r--src/nvim/generators/gen_eval.lua14
-rw-r--r--src/nvim/generators/gen_events.lua8
-rw-r--r--src/nvim/generators/gen_ex_cmds.lua9
-rw-r--r--src/nvim/generators/gen_options.lua6
-rw-r--r--src/nvim/generators/gen_unicode_tables.lua24
-rw-r--r--src/nvim/options.lua3
11 files changed, 107 insertions, 103 deletions
diff --git a/src/nvim/generators/c_grammar.lua b/src/nvim/generators/c_grammar.lua
index 8d50290ccc..1aa8223da0 100644
--- a/src/nvim/generators/c_grammar.lua
+++ b/src/nvim/generators/c_grammar.lua
@@ -1,4 +1,4 @@
-lpeg = require('lpeg')
+local lpeg = require('lpeg')
-- lpeg grammar for building api metadata from a set of header files. It
-- ignores comments and preprocessor commands and parses a very small subset
diff --git a/src/nvim/generators/gen_api_dispatch.lua b/src/nvim/generators/gen_api_dispatch.lua
index 286fef9a2f..95dcbc732e 100644
--- a/src/nvim/generators/gen_api_dispatch.lua
+++ b/src/nvim/generators/gen_api_dispatch.lua
@@ -1,4 +1,4 @@
-mpack = require('mpack')
+local mpack = require('mpack')
-- we need at least 4 arguments since the last two are output files
if arg[1] == '--help' then
@@ -11,27 +11,27 @@ if arg[1] == '--help' then
print(' rest: C files where API functions are defined')
end
assert(#arg >= 4)
-functions = {}
+local functions = {}
local nvimdir = arg[1]
package.path = nvimdir .. '/?.lua;' .. package.path
-- names of all headers relative to the source root (for inclusion in the
-- generated file)
-headers = {}
+local headers = {}
-- output h file with generated dispatch functions
-dispatch_outputf = arg[2]
+local dispatch_outputf = arg[2]
-- output h file with packed metadata
-funcs_metadata_outputf = arg[3]
+local funcs_metadata_outputf = arg[3]
-- output metadata mpack file, for use by other build scripts
-mpack_outputf = arg[4]
-lua_c_bindings_outputf = arg[5]
+local mpack_outputf = arg[4]
+local lua_c_bindings_outputf = arg[5]
-- set of function names, used to detect duplicates
-function_names = {}
+local function_names = {}
-c_grammar = require('generators.c_grammar')
+local c_grammar = require('generators.c_grammar')
-- read each input file, parse and append to the api metadata
for i = 6, #arg do
@@ -45,10 +45,10 @@ for i = 6, #arg do
local input = io.open(full_path, 'rb')
local tmp = c_grammar.grammar:match(input:read('*all'))
- for i = 1, #tmp do
- local fn = tmp[i]
+ for j = 1, #tmp do
+ local fn = tmp[j]
if not fn.noexport then
- functions[#functions + 1] = tmp[i]
+ functions[#functions + 1] = tmp[j]
function_names[fn.name] = true
if #fn.parameters ~= 0 and fn.parameters[1][2] == 'channel_id' then
-- this function should receive the channel id
@@ -83,7 +83,7 @@ end
-- Export functions under older deprecated names.
-- These will be removed eventually.
local deprecated_aliases = require("api.dispatch_deprecated")
-for i,f in ipairs(shallowcopy(functions)) do
+for _,f in ipairs(shallowcopy(functions)) do
local ismethod = false
if startswith(f.name, "nvim_") then
if startswith(f.name, "nvim__") then
@@ -135,9 +135,9 @@ for i,f in ipairs(shallowcopy(functions)) do
end
-- don't expose internal attributes like "impl_name" in public metadata
-exported_attributes = {'name', 'return_type', 'method',
- 'since', 'deprecated_since'}
-exported_functions = {}
+local exported_attributes = {'name', 'return_type', 'method',
+ 'since', 'deprecated_since'}
+local exported_functions = {}
for _,f in ipairs(functions) do
if not startswith(f.name, "nvim__") then
local f_exported = {}
@@ -158,14 +158,14 @@ end
-- serialize the API metadata using msgpack and embed into the resulting
-- binary for easy querying by clients
-funcs_metadata_output = io.open(funcs_metadata_outputf, 'wb')
-packed = mpack.pack(exported_functions)
-dump_bin_array = require("generators.dump_bin_array")
+local funcs_metadata_output = io.open(funcs_metadata_outputf, 'wb')
+local packed = mpack.pack(exported_functions)
+local dump_bin_array = require("generators.dump_bin_array")
dump_bin_array(funcs_metadata_output, 'funcs_metadata', packed)
funcs_metadata_output:close()
-- start building the dispatch wrapper output
-output = io.open(dispatch_outputf, 'wb')
+local output = io.open(dispatch_outputf, 'wb')
local function real_type(type)
local rv = type
@@ -209,20 +209,22 @@ for i = 1, #functions do
end
output:write('\n')
output:write('\n if (args.size != '..#fn.parameters..') {')
- output:write('\n api_set_error(error, kErrorTypeException, "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);')
+ output:write('\n api_set_error(error, kErrorTypeException, \
+ "Wrong number of arguments: expecting '..#fn.parameters..' but got %zu", args.size);')
output:write('\n goto cleanup;')
output:write('\n }\n')
-- Validation/conversion for each argument
for j = 1, #fn.parameters do
- local converted, convert_arg, param, arg
+ local converted, param
param = fn.parameters[j]
converted = 'arg_'..j
local rt = real_type(param[1])
if rt ~= 'Object' then
if rt:match('^Buffer$') or rt:match('^Window$') or rt:match('^Tabpage$') then
-- Buffer, Window, and Tabpage have a specific type, but are stored in integer
- output:write('\n if (args.items['..(j - 1)..'].type == kObjectType'..rt..' && args.items['..(j - 1)..'].data.integer >= 0) {')
+ output:write('\n if (args.items['..
+ (j - 1)..'].type == kObjectType'..rt..' && args.items['..(j - 1)..'].data.integer >= 0) {')
output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;')
else
output:write('\n if (args.items['..(j - 1)..'].type == kObjectType'..rt..') {')
@@ -230,16 +232,18 @@ for i = 1, #functions do
end
if rt:match('^Buffer$') or rt:match('^Window$') or rt:match('^Tabpage$') or rt:match('^Boolean$') then
-- accept nonnegative integers for Booleans, Buffers, Windows and Tabpages
- output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer >= 0) {')
+ output:write('\n } else if (args.items['..
+ (j - 1)..'].type == kObjectTypeInteger && args.items['..(j - 1)..'].data.integer >= 0) {')
output:write('\n '..converted..' = (handle_T)args.items['..(j - 1)..'].data.integer;')
end
-- accept empty lua tables as empty dictionarys
if rt:match('^Dictionary') then
- output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeArray && args.items['..(j - 1)..'].data.array.size == 0) {')
+ output:write('\n } else if (args.items['..(j - 1)..'].type == kObjectTypeArray && args.items['..(j - 1)..'].data.array.size == 0) {') --luacheck: ignore 631
output:write('\n '..converted..' = (Dictionary)ARRAY_DICT_INIT;')
end
output:write('\n } else {')
- output:write('\n api_set_error(error, kErrorTypeException, "Wrong type for argument '..j..', expecting '..param[1]..'");')
+ output:write('\n api_set_error(error, kErrorTypeException, \
+ "Wrong type for argument '..j..', expecting '..param[1]..'");')
output:write('\n goto cleanup;')
output:write('\n }\n')
else
@@ -316,19 +320,19 @@ end
output:write('\n}\n\n')
output:close()
-mpack_output = io.open(mpack_outputf, 'wb')
+local mpack_output = io.open(mpack_outputf, 'wb')
mpack_output:write(mpack.pack(functions))
mpack_output:close()
-local function include_headers(output, headers)
- for i = 1, #headers do
- if headers[i]:sub(-12) ~= '.generated.h' then
- output:write('\n#include "nvim/'..headers[i]..'"')
+local function include_headers(output_handle, headers_to_include)
+ for i = 1, #headers_to_include do
+ if headers_to_include[i]:sub(-12) ~= '.generated.h' then
+ output_handle:write('\n#include "nvim/'..headers_to_include[i]..'"')
end
end
end
-local function write_shifted_output(output, str)
+local function write_shifted_output(_, str)
str = str:gsub('\n ', '\n')
str = str:gsub('^ ', '')
str = str:gsub(' +$', '')
@@ -354,10 +358,10 @@ output:write([[
include_headers(output, headers)
output:write('\n')
-lua_c_functions = {}
+local lua_c_functions = {}
local function process_function(fn)
- lua_c_function_name = ('nlua_msgpack_%s'):format(fn.name)
+ local lua_c_function_name = ('nlua_msgpack_%s'):format(fn.name)
write_shifted_output(output, string.format([[
static int %s(lua_State *lstate)
@@ -384,11 +388,11 @@ local function process_function(fn)
local cparams = ''
local free_code = {}
for j = #fn.parameters,1,-1 do
- param = fn.parameters[j]
- cparam = string.format('arg%u', j)
- param_type = real_type(param[1])
- lc_param_type = real_type(param[1]):lower()
- extra = ((param_type == "Object" or param_type == "Dictionary") and "false, ") or ""
+ local param = fn.parameters[j]
+ local cparam = string.format('arg%u', j)
+ local param_type = real_type(param[1])
+ local lc_param_type = real_type(param[1]):lower()
+ local extra = ((param_type == "Object" or param_type == "Dictionary") and "false, ") or ""
if param[1] == "DictionaryOf(LuaRef)" then
extra = "true, "
end
@@ -433,6 +437,7 @@ local function process_function(fn)
return lua_error(lstate);
}
]]
+ local return_type
if fn.return_type ~= 'void' then
if fn.return_type:match('^ArrayOf') then
return_type = 'Array'
diff --git a/src/nvim/generators/gen_api_ui_events.lua b/src/nvim/generators/gen_api_ui_events.lua
index c8ab310b02..e9f30b84f0 100644
--- a/src/nvim/generators/gen_api_ui_events.lua
+++ b/src/nvim/generators/gen_api_ui_events.lua
@@ -1,20 +1,20 @@
-mpack = require('mpack')
+local mpack = require('mpack')
local nvimdir = arg[1]
package.path = nvimdir .. '/?.lua;' .. package.path
assert(#arg == 7)
-input = io.open(arg[2], 'rb')
-proto_output = io.open(arg[3], 'wb')
-call_output = io.open(arg[4], 'wb')
-remote_output = io.open(arg[5], 'wb')
-bridge_output = io.open(arg[6], 'wb')
-metadata_output = io.open(arg[7], 'wb')
-
-c_grammar = require('generators.c_grammar')
+local input = io.open(arg[2], 'rb')
+local proto_output = io.open(arg[3], 'wb')
+local call_output = io.open(arg[4], 'wb')
+local remote_output = io.open(arg[5], 'wb')
+local bridge_output = io.open(arg[6], 'wb')
+local metadata_output = io.open(arg[7], 'wb')
+
+local c_grammar = require('generators.c_grammar')
local events = c_grammar.grammar:match(input:read('*all'))
-function write_signature(output, ev, prefix, notype)
+local function write_signature(output, ev, prefix, notype)
output:write('('..prefix)
if prefix == "" and #ev.parameters == 0 then
output:write('void')
@@ -32,7 +32,7 @@ function write_signature(output, ev, prefix, notype)
output:write(')')
end
-function write_arglist(output, ev, need_copy)
+local function write_arglist(output, ev, need_copy)
output:write(' Array args = ARRAY_DICT_INIT;\n')
for j = 1, #ev.parameters do
local param = ev.parameters[j]
@@ -51,7 +51,7 @@ function write_arglist(output, ev, need_copy)
end
for i = 1, #events do
- ev = events[i]
+ local ev = events[i]
assert(ev.return_type == 'void')
if ev.since == nil and not ev.noexport then
@@ -75,11 +75,12 @@ for i = 1, #events do
end
if not ev.bridge_impl and not ev.noexport then
- send, argv, recv, recv_argv, recv_cleanup = '', '', '', '', ''
- argc = 1
+
+ local send, argv, recv, recv_argv, recv_cleanup = '', '', '', '', ''
+ local argc = 1
for j = 1, #ev.parameters do
local param = ev.parameters[j]
- copy = 'copy_'..param[2]
+ local copy = 'copy_'..param[2]
if param[1] == 'String' then
send = send..' String copy_'..param[2]..' = copy_string('..param[2]..');\n'
argv = argv..', '..copy..'.data, INT2PTR('..copy..'.size)'
@@ -169,9 +170,9 @@ remote_output:close()
bridge_output:close()
-- don't expose internal attributes like "impl_name" in public metadata
-exported_attributes = {'name', 'parameters',
+local exported_attributes = {'name', 'parameters',
'since', 'deprecated_since'}
-exported_events = {}
+local exported_events = {}
for _,ev in ipairs(events) do
local ev_exported = {}
for _,attr in ipairs(exported_attributes) do
@@ -187,7 +188,7 @@ for _,ev in ipairs(events) do
end
end
-packed = mpack.pack(exported_events)
-dump_bin_array = require("generators.dump_bin_array")
+local packed = mpack.pack(exported_events)
+local dump_bin_array = require("generators.dump_bin_array")
dump_bin_array(metadata_output, 'ui_events_metadata', packed)
metadata_output:close()
diff --git a/src/nvim/generators/gen_char_blob.lua b/src/nvim/generators/gen_char_blob.lua
index d860375e26..1702add2e4 100644
--- a/src/nvim/generators/gen_char_blob.lua
+++ b/src/nvim/generators/gen_char_blob.lua
@@ -13,16 +13,17 @@ local source_file = arg[1]
local target_file = arg[2]
local varname = arg[3]
-source = io.open(source_file, 'r')
-target = io.open(target_file, 'w')
+local source = io.open(source_file, 'r')
+local target = io.open(target_file, 'w')
target:write('#include <stdint.h>\n\n')
target:write(('static const uint8_t %s[] = {\n'):format(varname))
-num_bytes = 0
-MAX_NUM_BYTES = 15 -- 78 / 5: maximum number of bytes on one line
+local num_bytes = 0
+local MAX_NUM_BYTES = 15 -- 78 / 5: maximum number of bytes on one line
target:write(' ')
+local increase_num_bytes
increase_num_bytes = function()
num_bytes = num_bytes + 1
if num_bytes == MAX_NUM_BYTES then
@@ -33,7 +34,7 @@ end
for line in source:lines() do
for i = 1,string.len(line) do
- byte = string.byte(line, i)
+ local byte = string.byte(line, i)
assert(byte ~= 0)
target:write(string.format(' %3u,', byte))
increase_num_bytes()
diff --git a/src/nvim/generators/gen_declarations.lua b/src/nvim/generators/gen_declarations.lua
index c40c37bb3e..ad44613f42 100755
--- a/src/nvim/generators/gen_declarations.lua
+++ b/src/nvim/generators/gen_declarations.lua
@@ -10,7 +10,7 @@ local lpeg = require('lpeg')
local fold = function (func, ...)
local result = nil
- for i, v in ipairs({...}) do
+ for _, v in ipairs({...}) do
if result == nil then
result = v
else
@@ -107,7 +107,7 @@ local typ_part = concat(
)),
spaces
)
-local typ = one_or_more(typ_part)
+
local typ_id = two_or_more(typ_part)
local arg = typ_id -- argument name is swallowed by typ
local pattern = concat(
@@ -222,7 +222,6 @@ local non_static = header
local static = header
local filepattern = '^#%a* (%d+) "([^"]-)/?([^"/]+)"'
-local curfile
local init = 1
local curfile = nil
@@ -248,14 +247,14 @@ while init ~= nil do
else
declline = declline - 1
end
- elseif init < declendpos then
+ elseif init < declendpos then -- luacheck: ignore 542
-- Skipping over declaration
elseif is_needed_file then
s = init
- e = pattern:match(text, init)
+ local e = pattern:match(text, init)
if e ~= nil then
local declaration = text:sub(s, e - 1)
- -- Comments are really handled by preprocessor, so the following is not
+ -- Comments are really handled by preprocessor, so the following is not
-- needed
declaration = declaration:gsub('/%*.-%*/', '')
declaration = declaration:gsub('//.-\n', '\n')
diff --git a/src/nvim/generators/gen_eval.lua b/src/nvim/generators/gen_eval.lua
index 23435a1d0b..fa01935fd4 100644
--- a/src/nvim/generators/gen_eval.lua
+++ b/src/nvim/generators/gen_eval.lua
@@ -1,4 +1,4 @@
-mpack = require('mpack')
+local mpack = require('mpack')
local nvimsrcdir = arg[1]
local autodir = arg[2]
@@ -10,7 +10,7 @@ if nvimsrcdir == '--help' then
Usage:
lua geneval.lua src/nvim build/src/nvim/auto
-Will generate build/src/nvim/auto/funcs.generated.h with definition of functions
+Will generate build/src/nvim/auto/funcs.generated.h with definition of functions
static const array.
]])
os.exit(0)
@@ -23,8 +23,8 @@ local funcsfname = autodir .. '/funcs.generated.h'
local gperfpipe = io.open(funcsfname .. '.gperf', 'wb')
local funcs = require('eval').funcs
-local metadata = mpack.unpack(io.open(arg[3], 'rb'):read("*all"))
-for i,fun in ipairs(metadata) do
+local metadata = mpack.unpack(io.open(metadata_file, 'rb'):read("*all"))
+for _,fun in ipairs(metadata) do
if not fun.remote_only then
funcs[fun.name] = {
args=#fun.parameters,
@@ -53,14 +53,14 @@ VimLFuncDef;
]])
for name, def in pairs(funcs) do
- args = def.args or 0
+ local args = def.args or 0
if type(args) == 'number' then
args = {args, args}
elseif #args == 1 then
args[2] = 'MAX_FUNC_ARGS'
end
- func = def.func or ('f_' .. name)
- data = def.data or "NULL"
+ local func = def.func or ('f_' .. name)
+ local data = def.data or "NULL"
gperfpipe:write(('%s, %s, %s, &%s, (FunPtr)%s\n')
:format(name, args[1], args[2], func, data))
end
diff --git a/src/nvim/generators/gen_events.lua b/src/nvim/generators/gen_events.lua
index d03c787b2b..98c3254e7a 100644
--- a/src/nvim/generators/gen_events.lua
+++ b/src/nvim/generators/gen_events.lua
@@ -13,8 +13,8 @@ local auevents = require('auevents')
local events = auevents.events
local aliases = auevents.aliases
-enum_tgt = io.open(fileio_enum_file, 'w')
-names_tgt = io.open(names_file, 'w')
+local enum_tgt = io.open(fileio_enum_file, 'w')
+local names_tgt = io.open(names_file, 'w')
enum_tgt:write('typedef enum auto_event {')
names_tgt:write([[
@@ -42,8 +42,8 @@ enum_tgt:write('\n} event_T;\n')
names_tgt:write('\n};\n')
names_tgt:write('\nstatic AutoPat *first_autopat[NUM_EVENTS] = {\n ')
-line_len = 1
-for i = 1,((#events) - 1) do
+local line_len = 1
+for _ = 1,((#events) - 1) do
line_len = line_len + #(' NULL,')
if line_len > 80 then
names_tgt:write('\n ')
diff --git a/src/nvim/generators/gen_ex_cmds.lua b/src/nvim/generators/gen_ex_cmds.lua
index 7859d7c71a..075d8ba9cc 100644
--- a/src/nvim/generators/gen_ex_cmds.lua
+++ b/src/nvim/generators/gen_ex_cmds.lua
@@ -7,8 +7,8 @@ if nvimsrcdir == '--help' then
Usage:
lua genex_cmds.lua src/nvim build/include build/src/nvim/auto
-Will generate files build/include/ex_cmds_enum.generated.h with cmdidx_T
-enum and build/src/nvim/auto/ex_cmds_defs.generated.h with main Ex commands
+Will generate files build/include/ex_cmds_enum.generated.h with cmdidx_T
+enum and build/src/nvim/auto/ex_cmds_defs.generated.h with main Ex commands
definitions.
]])
os.exit(0)
@@ -23,10 +23,7 @@ local enumfile = io.open(enumfname, 'w')
local defsfile = io.open(defsfname, 'w')
local defs = require('ex_cmds')
-local lastchar = nil
-local i
-local cmd
local first = true
local byte_a = string.byte('a')
@@ -58,7 +55,7 @@ defsfile:write(string.format([[
static CommandDefinition cmdnames[%u] = {
]], #defs))
local cmds, cmdidxs1, cmdidxs2 = {}, {}, {}
-for i, cmd in ipairs(defs) do
+for _, cmd in ipairs(defs) do
local enumname = cmd.enum or ('CMD_' .. cmd.command)
local byte_cmd = cmd.command:sub(1, 1):byte()
if byte_a <= byte_cmd and byte_cmd <= byte_z then
diff --git a/src/nvim/generators/gen_options.lua b/src/nvim/generators/gen_options.lua
index d9c65e17c5..a8cf496cb9 100644
--- a/src/nvim/generators/gen_options.lua
+++ b/src/nvim/generators/gen_options.lua
@@ -20,7 +20,7 @@ end
local options = require('options')
-cstr = options.cstr
+local cstr = options.cstr
local type_flags={
bool='P_BOOL',
@@ -108,12 +108,12 @@ get_cond = function(c, base_string)
return cond_string
end
-value_dumpers = {
+local value_dumpers = {
['function']=function(v) return v() end,
string=cstr,
boolean=function(v) return v and 'true' or 'false' end,
number=function(v) return ('%iL'):format(v) end,
- ['nil']=function(v) return '0L' end,
+ ['nil']=function(_) return '0L' end,
}
local get_value = function(v)
diff --git a/src/nvim/generators/gen_unicode_tables.lua b/src/nvim/generators/gen_unicode_tables.lua
index 3130cecd82..aa96c97bc1 100644
--- a/src/nvim/generators/gen_unicode_tables.lua
+++ b/src/nvim/generators/gen_unicode_tables.lua
@@ -1,16 +1,16 @@
-- Script creates the following tables in unicode_tables.generated.h:
--
--- 1. doublewidth and ambiguous tables: sorted list of non-overlapping closed
--- intervals. Codepoints in these intervals have double (W or F) or ambiguous
+-- 1. doublewidth and ambiguous tables: sorted list of non-overlapping closed
+-- intervals. Codepoints in these intervals have double (W or F) or ambiguous
-- (A) east asian width respectively.
--- 2. combining table: same as the above, but characters inside are combining
+-- 2. combining table: same as the above, but characters inside are combining
-- characters (i.e. have general categories equal to Mn, Mc or Me).
--- 3. foldCase, toLower and toUpper tables used to convert characters to
--- folded/lower/upper variants. In these tables first two values are
--- character ranges: like in previous tables they are sorted and must be
--- non-overlapping. Third value means step inside the range: e.g. if it is
--- 2 then interval applies only to first, third, fifth, … character in range.
--- Fourth value is number that should be added to the codepoint to yield
+-- 3. foldCase, toLower and toUpper tables used to convert characters to
+-- folded/lower/upper variants. In these tables first two values are
+-- character ranges: like in previous tables they are sorted and must be
+-- non-overlapping. Third value means step inside the range: e.g. if it is
+-- 2 then interval applies only to first, third, fifth, … character in range.
+-- Fourth value is number that should be added to the codepoint to yield
-- folded/lower/upper codepoint.
-- 4. emoji_width and emoji_all tables: sorted lists of non-overlapping closed
-- intervals of Emoji characters. emoji_width contains all the characters
@@ -38,7 +38,7 @@ local split_on_semicolons = function(s)
local ret = {}
local idx = 1
while idx <= #s + 1 do
- item = s:match('^[^;]*', idx)
+ local item = s:match('^[^;]*', idx)
idx = idx + #item + 1
if idx <= #s + 1 then
assert(s:sub(idx - 1, idx - 1) == ';')
@@ -208,7 +208,7 @@ local build_width_table = function(ut_fp, dataprops, widthprops, widths,
-- But use all chars from a range.
local dp = dataprops[dataidx]
if (n_last > n) or (not (({Mn=true, Mc=true, Me=true})[dp[3]])) then
- if start >= 0 and end_ + 1 == n then
+ if start >= 0 and end_ + 1 == n then -- luacheck: ignore 542
-- Continue with the same range.
else
if start >= 0 then
@@ -235,6 +235,8 @@ local build_emoji_table = function(ut_fp, emojiprops, doublewidth, ambiwidth)
for _, p in ipairs(emojiprops) do
if p[2]:match('Emoji%s+#') then
local rng_start, rng_end = p[1]:find('%.%.')
+ local n
+ local n_last
if rng_start then
n = tonumber(p[1]:sub(1, rng_start - 1), 16)
n_last = tonumber(p[1]:sub(rng_end + 1), 16)
diff --git a/src/nvim/options.lua b/src/nvim/options.lua
index c963ddd49c..30409807aa 100644
--- a/src/nvim/options.lua
+++ b/src/nvim/options.lua
@@ -40,7 +40,7 @@ local imacros=function(s)
return '(intptr_t)' .. s
end
end
-local N_=function(s)
+local N_=function(s) -- luacheck: ignore 211
return function()
return 'N_(' .. cstr(s) .. ')'
end
@@ -189,7 +189,6 @@ return {
},
{
full_name='belloff', abbreviation='bo',
- deny_duplicates=true,
type='string', list='comma', scope={'global'},
deny_duplicates=true,
vi_def=true,