mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2025-01-21 12:51:56 +01:00
add elipsization to lsp_progress mzte-nv module
This commit is contained in:
parent
c974057a57
commit
fc49a634a8
1 changed files with 9 additions and 2 deletions
|
@ -70,18 +70,25 @@ fn lFormatClient(l: *c.lua_State) !c_int {
|
|||
|
||||
try del.print("%#Special#[{s}] %#Comment#{s}", .{ client_name, spinner });
|
||||
|
||||
const max_msgs = 2;
|
||||
|
||||
const nmsgs = c.lua_objlen(l, 3);
|
||||
for (1..nmsgs + 1) |i| {
|
||||
const nshown = @min(nmsgs, max_msgs);
|
||||
for (1..nshown + 1) |i| {
|
||||
_ = c.lua_rawgeti(l, 3, @intCast(i));
|
||||
defer c.lua_pop(l, 1);
|
||||
|
||||
const msg = ffi.luaToString(l, -1);
|
||||
try del.push(msg);
|
||||
if (i != nmsgs) {
|
||||
if (i != nshown) {
|
||||
try del.writer.writeAll("%#Operator#,");
|
||||
}
|
||||
}
|
||||
|
||||
if (nmsgs > max_msgs) {
|
||||
try del.push("%#Comment#");
|
||||
}
|
||||
|
||||
ffi.luaPushString(l, buf.slice());
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue