summaryrefslogtreecommitdiff
path: root/lua/99/state.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/99/state.lua')
-rw-r--r--lua/99/state.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/lua/99/state.lua b/lua/99/state.lua
index 6e38c5f..a67acee 100644
--- a/lua/99/state.lua
+++ b/lua/99/state.lua
@@ -2,6 +2,7 @@ local utils = require("99.utils")
local Agents = require("99.extensions.agents")
local Extensions = require("99.extensions")
local Tracking = require("99.state.tracking")
+local Window = require("99.window")
local _99_STATE_FILE = "state"
local function default_completion()
@@ -98,6 +99,17 @@ function State:tmp_dir()
return get_tmp_dir(self)
end
+--- @return boolean
+function State:active()
+ _ = self
+ if Window.has_active_window() then
+ return true
+ end
+
+ local qf = vim.fn.getqflist({ winid = 0 })
+ return qf.winid ~= 0
+end
+
--- TODO: This is something to understand. I bet that this is going to need
--- a lot of performance tuning. I am just reading every file, and this could
--- take a decent amount of time if there are lots of rules.