Fix bad _input assignemtn

pull/3/head
Iron-E 4 years ago
parent d5133e2c2f
commit e3a6b651a1
No known key found for this signature in database
GPG Key ID: 19B71B7B7B021D22

@ -608,6 +608,16 @@ want to for their mode specifically. >
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
functions *libmodal-lua-Mode-functions* functions *libmodal-lua-Mode-functions*
`self`.exit *libmodal-lua-Mode.exit*
A liason to the `g:`{name}`ModeExit` variable.
Type: ~
`libmodal.Vars`
Value: ~
`libmodal.Vars.new('exit', `{name}`)`
`self`.indicator *libmodal-lua-Mode.indicator* `self`.indicator *libmodal-lua-Mode.indicator*
The message that is shown in the bottom-left corner of the screen while the The message that is shown in the bottom-left corner of the screen while the

@ -181,8 +181,8 @@ end
------------------------------- -------------------------------
function _metaMode:_inputLoop() function _metaMode:_inputLoop()
-- If the mode is not handling exit events automatically and the global exit var is true. -- If the mode is not handling exit events automatically and the global exit var is true.
if self._exit.supress if self.exit.supress
and globals.is_true(self._exit:nvimGet()) and globals.is_true(self.exit:nvimGet())
then then
return false return false
end end
@ -202,7 +202,7 @@ function _metaMode:_inputLoop()
self.input:nvimSet(userInput) self.input:nvimSet(userInput)
-- Make sure that the user doesn't want to exit. -- Make sure that the user doesn't want to exit.
if not self._exit.supress if not self.exit.supress
and userInput == globals.ESC_NR then return false and userInput == globals.ESC_NR then return false
-- If the second argument was a dict, parse it. -- If the second argument was a dict, parse it.
elseif type(self._instruction) == globals.TYPE_TBL then elseif type(self._instruction) == globals.TYPE_TBL then
@ -251,9 +251,9 @@ function Mode.new(name, instruction, ...)
-- Inherit the metatable. -- Inherit the metatable.
local self = setmetatable( local self = setmetatable(
{ {
['_exit'] = Vars.new('exit', name), ['exit'] = Vars.new('exit', name),
['indicator'] = Indicator.mode(name), ['indicator'] = Indicator.mode(name),
['_input'] = Vars.new('input', name), ['input'] = Vars.new('input', name),
['_instruction'] = instruction, ['_instruction'] = instruction,
['_name'] = name, ['_name'] = name,
['_winState'] = utils.WindowState.new(), ['_winState'] = utils.WindowState.new(),
@ -262,7 +262,7 @@ function Mode.new(name, instruction, ...)
) )
-- Define the exit flag -- Define the exit flag
self._exit.supress = (function(optionalValue) self.exit.supress = (function(optionalValue)
if optionalValue then if optionalValue then
return globals.is_true(optionalValue) return globals.is_true(optionalValue)
else else

Loading…
Cancel
Save