add: default loading from fidget to lspprogress

This commit is contained in:
asep komarudin 2024-03-03 07:23:42 +07:00
parent 53b42062e3
commit ee5301ba54
6 changed files with 93 additions and 12 deletions

View file

@ -1,3 +1,23 @@
local function ambilKataDariKiri(kalimat, jumlahKata)
local hasil = ""
local posisiAwal = 1
local kataKe = 0
while kataKe < jumlahKata do
local posisiSpasi = string.find(kalimat, " ", posisiAwal)
if posisiSpasi then
hasil = hasil .. string.sub(kalimat, posisiAwal, posisiSpasi - 1) .. " "
posisiAwal = posisiSpasi + 1
else
hasil = hasil .. string.sub(kalimat, posisiAwal)
break
end
kataKe = kataKe + 1
end
return hasil
end
local fidget = true
local lualine = false
local data_exists, custom_ui = pcall(require, "core.config")
@ -45,13 +65,13 @@ return {
require("lsp-progress").setup({
client_format = function(client_name, spinner, series_messages)
return #series_messages > 0
and (spinner .. " " .. string.sub(table.concat(series_messages, ", "), 1, 25) .. " ...")
and (spinner .. " " .. ambilKataDariKiri(table.concat(series_messages, ", "), 4) .. "...")
or nil
end,
format = function(client_messages)
local sign = ""
return #client_messages > 0
and (sign .. " " .. string.sub(table.concat(client_messages, " "), 1, 25) .. " ...")
and (sign .. " " .. ambilKataDariKiri(table.concat(client_messages, " "), 4) .. "...")
or sign
end,
})