aboutsummaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua32
1 files changed, 18 insertions, 14 deletions
diff --git a/init.lua b/init.lua
index 52f8d08..9600203 100644
--- a/init.lua
+++ b/init.lua
@@ -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