Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Harmonized component layout -> filetype_lsp secondary right" #18

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lua/slimline/components.lua
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function M.filetype_lsp(config, sep)
if status then
icon = ' ' .. MiniIcons.get('filetype', filetype)
end
filetype = highlights.hl_content(icon .. ' ' .. filetype .. ' ', highlights.hls.primary.text, sep.left, nil)
filetype = highlights.hl_content(icon .. ' ' .. filetype .. ' ', highlights.hls.primary.text, nil, sep.right)

local attached_clients = vim.lsp.get_clients { bufnr = 0 }
local it = vim.iter(attached_clients)
Expand All @@ -228,16 +228,16 @@ function M.filetype_lsp(config, sep)
local names = it:totable()
local lsp_clients = string.format('%s', table.concat(names, ','))

local filetype_hl_sep_right = highlights.hls.primary.sep
local filetype_hl_sep_left = highlights.hls.primary.sep
if #attached_clients > 0 then
filetype_hl_sep_right = highlights.hls.primary.sep_transition
filetype_hl_sep_left = highlights.hls.primary.sep_transition
end
filetype = filetype .. highlights.hl_content(config.sep.right, filetype_hl_sep_right)
lsp_clients = highlights.hl_content(' ' .. lsp_clients .. ' ', highlights.hls.secondary.text, nil, sep.right)
filetype = highlights.hl_content(config.sep.left, filetype_hl_sep_left) .. filetype
lsp_clients = highlights.hl_content(' ' .. lsp_clients .. ' ', highlights.hls.secondary.text, sep.left)

local result = filetype
if #attached_clients > 0 then
result = result .. lsp_clients
result = lsp_clients .. result
end
return result
end
Expand Down