Cleanup using sumneko_lua

pull/3/head release/0.6.2
Iron-E 4 years ago
parent 94ed9463bf
commit f190a91d81
No known key found for this signature in database
GPG Key ID: 19B71B7B7B021D22

@ -11,7 +11,7 @@ function _inputHistory:clear(indexToCheck)
end
end
function fooMode()
local function fooMode()
_inputHistory[#_inputHistory + 1] = string.char(
api.nvim_get_var('fooModeInput')
)

@ -2,13 +2,13 @@ local libmodal = require('libmodal')
local fooModeRecurse = 0
local fooModeCombos = {
['z'] = 'lua fooMode()'
['z'] = 'lua FooMode()'
}
function fooMode()
function FooMode()
fooModeRecurse = fooModeRecurse + 1
libmodal.mode.enter('FOO' .. fooModeRecurse, fooModeCombos)
fooModeRecurse = fooModeRecurse - 1
end
fooMode()
FooMode()

@ -18,7 +18,7 @@ local layer = libmodal.Layer.new({
layer:enter()
-- add a global function for exiting the mode.
function libmodal_layer_example_exit()
function LibmodalLayerExampleExit()
layer:exit()
end
@ -27,7 +27,7 @@ layer:map('n', 'z', 'gg', {['noremap'] = true})
-- add an additional mapping for `q`.
layer:map(
'n', 'q', ':lua libmodal_layer_example_exit()<CR>',
'n', 'q', ':lua LibmodalLayerExampleExit()<CR>',
{['noremap'] = true, ['silent'] = true}
)

@ -2,7 +2,7 @@ local libmodal = require('libmodal')
local api = vim.api
local commandList = {'new', 'close', 'last'}
function fooMode()
function FooMode()
local userInput = vim.api.nvim_get_var('fooModeInput')
if userInput == 'new' then
api.nvim_command('tabnew')
@ -13,4 +13,4 @@ function fooMode()
end
end
libmodal.prompt.enter('FOO', fooMode, commandList)
libmodal.prompt.enter('FOO', FooMode, commandList)

@ -1,20 +1,20 @@
local libmodal = require('libmodal')
local fooModeRecurse = 1
function fooMode()
function FooMode()
local userInput = string.char(vim.api.nvim_get_var(
'foo' .. tostring(fooModeRecurse) .. 'ModeInput'
))
if userInput == 'z' then
fooModeRecurse = fooModeRecurse + 1
enter()
Enter()
fooModeRecurse = fooModeRecurse - 1
end
end
function enter()
libmodal.mode.enter('FOO' .. fooModeRecurse, fooMode)
function Enter()
libmodal.mode.enter('FOO' .. fooModeRecurse, FooMode)
end
enter()
Enter()

@ -1,16 +1,17 @@
local api = vim.api
local libmodal = require('libmodal')
function fooMode()
local function fooMode()
local userInput = string.char(
vim.api.nvim_get_var('fooModeInput')
api.nvim_get_var('fooModeInput')
)
if userInput == '' then
vim.api.nvim_command("echom 'You cant leave using <Esc>.'")
api.nvim_command("echom 'You cant leave using <Esc>.'")
elseif userInput == 'q' then
vim.api.nvim_set_var('fooModeExit', true)
api.nvim_set_var('fooModeExit', true)
end
end
vim.api.nvim_set_var('fooModeExit', 0)
api.nvim_set_var('fooModeExit', 0)
libmodal.mode.enter('FOO', fooMode, true)

@ -19,7 +19,6 @@ return {
end,
is_true = function(val)
return val == true or val == _VIM_TRUE
return val == true or val == _VIM_TRUE
end
}

@ -46,17 +46,17 @@ end
----------------------------------------
function Help.new(commandsOrMaps, title)
-- find the longest key in the table.
local longestKey = 0
for k, v in pairs(commandsOrMaps) do
local len = string.len(k)
if len > longestKey then
longestKey = len
local longestKeyLen = 0
for key, _ in pairs(commandsOrMaps) do
local keyLen = string.len(key)
if keyLen > longestKeyLen then
longestKeyLen = keyLen
end
end
-- adjust the longest key length if the table header is longer.
if longestKey < string.len(title) then
longestKey = string.len(title)
if longestKeyLen < string.len(title) then
longestKeyLen = string.len(title)
end
-- define the separator for entries in the help table.
@ -73,7 +73,7 @@ function Help.new(commandsOrMaps, title)
* The aligned `tbl`.
]]
----------------------
function tabAlign(tbl)
local function tabAlign(tbl)
local toPrint = {}
for k, v in pairs(tbl) do
toPrint[#toPrint + 1] = k
@ -83,7 +83,7 @@ function Help.new(commandsOrMaps, title)
if byte <= 32 or byte == 127 then len = len + 1
end
for i = len, longestKey do
for _ = len, longestKeyLen do
toPrint[#toPrint + 1] = ' '
end
toPrint[#toPrint + 1] = table.concat(SEPARATOR_TEMPLATE, v)

Loading…
Cancel
Save