From 27b308f56062db15cbe32aded5a5b471253b6089 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 14 Sep 2024 21:37:05 +0200 Subject: scroll last message to the top of the message window --- init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 15f970e..a7d5236 100644 --- a/init.lua +++ b/init.lua @@ -595,18 +595,19 @@ 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 if lspc.show_message == 'message' then - vis:message((hdr or '') .. msg) + local to_show = (hdr or '') .. msg .. '\n' + vis:message(to_show) + vis.win.selection = vis.win.file.size - #to_show + vis:feedkeys('zt') elseif lspc.show_message == 'open' then vis:command('open') -- cgit v1.2.3