(local M {}) (local module_name "map_utils") (local fn_store []) (fn register_fn [new_fn] (do (table.insert fn_store new_fn) (length fn_store))) (fn M.apply_function [id] ((. fn_store id))) (fn M.apply_expr [id] (vim.api.nvim_replace_termcodes ((. fn_store id)) true true true)) (fn M.lua_fn [lfn] (string.format "lua require('%s').apply_function(%s)" module_name (register_fn lfn))) (fn M.lua_expr [lfn] (string.format "v:lua.require'%s'.apply_expr(%s)" module_name (register_fn lfn))) M