summaryrefslogtreecommitdiff
path: root/lua/clever_f/testing/memory_host.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/clever_f/testing/memory_host.lua')
-rw-r--r--lua/clever_f/testing/memory_host.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/lua/clever_f/testing/memory_host.lua b/lua/clever_f/testing/memory_host.lua
index 42dab71..459c9a8 100644
--- a/lua/clever_f/testing/memory_host.lua
+++ b/lua/clever_f/testing/memory_host.lua
@@ -163,6 +163,7 @@ function MemoryHost.new(options)
_prompts = {},
_redraws = {},
_diagnostics = {},
+ _highlight_groups = copy(options.highlight_groups or {}),
_highlights = {},
_timers = {},
_event_registrations = {},
@@ -646,6 +647,22 @@ function MemoryHost:diagnostics()
return copy(self._diagnostics)
end
+function MemoryHost:read_highlight_group(name)
+ if type(name) ~= "string" or name == "" then
+ error("highlight group name must be a nonempty string", 2)
+ end
+ local definition = self._highlight_groups[name]
+ self:_record("read_highlight_group", {
+ name = name,
+ defined = definition ~= nil,
+ })
+ return copy(definition)
+end
+
+function MemoryHost:highlight_groups()
+ return copy(self._highlight_groups)
+end
+
function MemoryHost:create_highlight(specification)
if type(specification) ~= "table" then
error("highlight specification must be a table", 2)