feat: Allow overriding actions from mappings (#248)

This commit is contained in:
TJ DeVries
2020-11-16 10:58:30 -05:00
committed by GitHub
parent ad7280e0b9
commit 985856946e
6 changed files with 301 additions and 58 deletions

View File

@@ -1,12 +1,21 @@
local state = {}
TelescopeGlobalState = TelescopeGlobalState or {}
TelescopeGlobalState.global = TelescopeGlobalState.global or {}
--- Set the status for a particular prompt bufnr
function state.set_status(prompt_bufnr, status)
TelescopeGlobalState[prompt_bufnr] = status
end
function state.set_global_key(key, value)
TelescopeGlobalState.global[key] = value
end
function state.get_global_key(key)
return TelescopeGlobalState.global[key]
end
function state.get_status(prompt_bufnr)
return TelescopeGlobalState[prompt_bufnr] or {}
end