summaryrefslogtreecommitdiff
path: root/lua/telescope/state.lua
blob: a014a0ddcdf95b4d6f237ec144c9a72c9d9027b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
local state = {}

TelescopeGlobalState = TelescopeGlobalState or {}

--- Set the status for a particular prompt bufnr
function state.set_status(prompt_bufnr, status)
  TelescopeGlobalState[prompt_bufnr] = status
end

function state.get_status(prompt_bufnr)
  return TelescopeGlobalState[prompt_bufnr] or {}
end

function state.clear_status(prompt_bufnr)
  state.set_status(prompt_bufnr, nil)
end

function state.get_existing_prompts()
  return vim.tbl_keys(TelescopeGlobalState)
end

return state