diff options
Diffstat (limited to 'lua/clever_f')
| -rw-r--r-- | lua/clever_f/acquisition_service.lua | 20 |
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) |
