summaryrefslogtreecommitdiff
path: root/lua/clever_f
diff options
context:
space:
mode:
authorJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:16:32 +0200
committerJackson Moore <jacksonmoore@tuta.io>2026-09-04 12:16:32 +0200
commitd3288bd81eb106ec0100030e6cce083231355329 (patch)
tree6fd170ef51a4b65bcae2f4f0c07b822c3ea50657 /lua/clever_f
parent0f763ecb835fe942fd5cd6c497847322cf6dc399 (diff)
Suppress macro acquisition redraws
Diffstat (limited to 'lua/clever_f')
-rw-r--r--lua/clever_f/acquisition_service.lua20
1 files changed, 15 insertions, 5 deletions
diff --git a/lua/clever_f/acquisition_service.lua b/lua/clever_f/acquisition_service.lua
index 5cbe6ab..103054a 100644
--- a/lua/clever_f/acquisition_service.lua
+++ b/lua/clever_f/acquisition_service.lua
@@ -252,6 +252,18 @@ function TemporaryResourceScope:set_input_packet(packet)
return set_scope_resource(self, "input_packet", packet)
end
+function TemporaryResourceScope:request_redraw(kind)
+ local record = scope_records[self]
+ if record == nil then
+ fail("temporary resource scope is invalid", 2)
+ end
+ if not record.interactive then
+ return false
+ end
+ record.host:redraw(kind)
+ return true
+end
+
function TemporaryResourceScope:mark_prompt_shown()
return set_scope_resource(self, "prompt_shown", true)
end
@@ -340,7 +352,7 @@ function TemporaryResourceScope:release()
and record.acquisition_completed
then
release_operation(function()
- record.host:redraw("full")
+ self:request_redraw("full")
end)
end
if record.direct_marker ~= nil then
@@ -732,9 +744,7 @@ local function acquire_in_scope(record, request, scope)
request.position,
current_window(record)
))
- if interactive then
- record.host:redraw("screen")
- end
+ scope:request_redraw("screen")
end
if acquisition.mark_direct and interactive then
local view = scope:set_text_view(text_topology.from_host(record.host))
@@ -752,7 +762,7 @@ local function acquire_in_scope(record, request, scope)
positions,
window
))
- record.host:redraw("screen")
+ scope:request_redraw("screen")
end
if acquisition.show_prompt and interactive then
record.host:show_prompt(M.PROMPT)