aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-09-14 21:37:05 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2024-09-14 21:37:05 +0200
commit27b308f56062db15cbe32aded5a5b471253b6089 (patch)
treebf037dfca68d2ea3490a67eca4921de4f02739cb /init.lua
parentd1867580a8ca53b7887e0239b34e5a5c3bcbc10e (diff)
downloadvis-lspc-27b308f56062db15cbe32aded5a5b471253b6089.tar.gz
vis-lspc-27b308f56062db15cbe32aded5a5b471253b6089.zip
scroll last message to the top of the message window
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua7
1 files changed, 4 insertions, 3 deletions
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')