diff --git a/doc/libmodal.txt b/doc/libmodal.txt index 8701627..01183d4 100644 --- a/doc/libmodal.txt +++ b/doc/libmodal.txt @@ -94,7 +94,7 @@ See: |api|, |lua-api|, https://github.com/Iron-E/nvim-tabmode, -------------------------------------------------------------------------------- VARIABLES *libmodal-usage-variables* -`vim.g`.libmodalActiveModeName +`vim.g`.libmodalActiveModeName *g:libmodalActiveModeName* The name of the currently active |libmodal-mode|. @@ -386,6 +386,19 @@ FUNCTIONS *libmodal-usage-function |lua-eval| For type conversions between Vimscript to |Lua|. |libmodal-examples| For examples of this function. +-------------------------------------------------------------------------------- +EVENTS *libmodal-usage-events* + +|libmodal| provides several |User| |autocmd-events| which you can hook into in +order to ensure that certain things happen before and after a |libmodal-mode| +is entered or left. + + *LibmodalModeEnterPre* +`LibmodalModeEnterPre`: before entering a |libmodal-mode|. + + *LibmodalModeLeavePost* +`LibmodalModeLeavePost`: after exiting a |libmodal-mode|. + ================================================================================ 3. Examples *libmodal-examples* diff --git a/lua/libmodal/src/Mode.lua b/lua/libmodal/src/Mode.lua index 7bfa57d..4ff4f6d 100644 --- a/lua/libmodal/src/Mode.lua +++ b/lua/libmodal/src/Mode.lua @@ -81,6 +81,7 @@ function Mode:check_input_for_mapping() end) ) else -- the command was an actual vim command. + --- @diagnostic disable-next-line:param-type-mismatch already checked `cmd` != `table` self.execute_instruction(cmd) self.input_bytes:clear() end @@ -217,6 +218,7 @@ return self.input_bytes = setmetatable({}, InputBytes) -- build the parse tree. + --- @diagnostic disable-next-line:param-type-mismatch already checked `self.instruction` != `table` self.mappings = ParseTable.new(self.instruction) -- create a table for mode-specific data.