From 0ba823967ec9a4382ad683316795f50212515e58 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 14 Sep 2024 18:44:47 +0200 Subject: properly close the message window after applying a workspaceEdit --- init.lua | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 3cff5ec..1d66df5 100644 --- a/init.lua +++ b/init.lua @@ -430,6 +430,19 @@ local function vis_apply_textEdits(win, file, textEdits) win:draw() end +--- Close the message window +-- TODO: close the dedicated lspc message window +local function lspc_close_message_win() + if lspc.show_message == 'message' then + vis:message('') + vis:command('q') + else + end +end + +--- Present a message to the user +-- TODO: scroll the message window +-- TODO: use a dedicated lspc message window local function lspc_show_message(msg, hdr, syntax) local current_win = vis.win @@ -485,7 +498,7 @@ local function vis_apply_workspaceEdit(_, _, workspaceEdit) local confirmation = lspc_confirm('apply changes:') -- close summary window - vis:command('q') + lspc_close_message_win() if not confirmation then return -- cgit v1.2.3