diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2026-04-22 19:48:41 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2026-04-22 19:48:41 +0200 |
| commit | ff5c5ce59764e20d66f47cdc09f6a81938c5a641 (patch) | |
| tree | 5c236bf818e255e1e63bc24417b4142d8f31cdcf /init.lua | |
| parent | 629a68029d1f2344f4f7526d576250ad0e526c1f (diff) | |
| parent | ee7d98607dc67b08cf554e2cfb7442407f94ce38 (diff) | |
| download | vis-lspc-ff5c5ce59764e20d66f47cdc09f6a81938c5a641.tar.gz vis-lspc-ff5c5ce59764e20d66f47cdc09f6a81938c5a641.zip | |
Merge branch 'Topoetry-show_message-info'
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 32 |
1 files changed, 18 insertions, 14 deletions
@@ -454,22 +454,26 @@ end local function lspc_show_message(msg, hdr, syntax) local current_win = vis.win - if lspc.show_message == 'message' then - 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') - if syntax then - vis:command('set syntax ' .. syntax) - end + if string.find(string.sub(msg, 2, -2), "\n") then + if lspc.show_message == 'message' then + 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') + if syntax then + vis:command('set syntax ' .. syntax) + end - vis.win.file:insert(0, msg) - vis.win.selection.pos = 0 + vis.win.file:insert(0, msg) + vis.win.selection.pos = 0 + else + lspc:err('invalid message configuration "' .. lspc.show_message .. '".') + end else - lspc:err('invalid message configuration "' .. lspc.show_message .. '".') + vis:info(msg) end -- reset the focus to the current window |
