File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,9 @@ local function statusline_lsp()
48
48
for _ , msg in ipairs (buf_messages ) do
49
49
local name = aliases [msg .name ] or msg .name
50
50
local client_name = ' [' .. name .. ' ]'
51
+ local contents = ' '
51
52
if msg .progress then
52
- local contents = msg .title
53
+ contents = msg .title
53
54
if msg .message then
54
55
contents = contents .. ' ' .. msg .message
55
56
end
@@ -61,11 +62,23 @@ local function statusline_lsp()
61
62
if msg .spinner then
62
63
contents = vim .g .spinner_frames [(msg .spinner % # vim .g .spinner_frames ) + 1 ] .. ' ' .. contents
63
64
end
65
+ elseif msg .status then
66
+ contents = msg .content
67
+ if msg .uri then
68
+ local filename = vim .uri_to_fname (msg .uri )
69
+ filename = vim .fn .fnamemodify (filename , ' :~:.' )
70
+ local space = math.min (60 , math.floor (0.6 * vim .fn .winwidth (0 )))
71
+ if # filename > space then
72
+ filename = vim .fn .pathshorten (filename )
73
+ end
64
74
65
- table.insert (msgs , client_name .. ' ' .. contents )
75
+ contents = ' (' .. filename .. ' ) ' .. contents
76
+ end
66
77
else
67
- table.insert ( msgs , client_name .. ' ' .. msg .content )
78
+ contents = msg .content
68
79
end
80
+
81
+ table.insert (msgs , client_name .. ' ' .. contents )
69
82
end
70
83
71
84
local base_status = vim .trim (table.concat (status_parts , ' ' ) .. ' ' .. table.concat (msgs , ' ' ))
You can’t perform that action at this time.
0 commit comments