diff options
Diffstat (limited to 'lua/telescope/make_entry.lua')
| -rw-r--r-- | lua/telescope/make_entry.lua | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/lua/telescope/make_entry.lua b/lua/telescope/make_entry.lua index 2b27328..45601af 100644 --- a/lua/telescope/make_entry.lua +++ b/lua/telescope/make_entry.lua @@ -862,15 +862,16 @@ function make_entry.gen_from_lsp_diagnostics(opts) for _, v in pairs(lsp_type_diagnostic) do signs[v] = vim.trim(vim.fn.sign_getdefined("LspDiagnosticsSign" .. v)[1].text) end - -- expose line width for longer msg if opts.hide_filename - local line_width = utils.get_default(opts.line_width, 48) + + local layout = { + { width = 9 }, + { remaining = true } + } + local line_width = utils.get_default(opts.line_width, 47) + if not opts.hide_filename then table.insert(layout, 2, {width = line_width}) end local displayer = entry_display.create { separator = "▏", - items = { - { width = 11 }, - { width = line_width }, - { remaining = true } - } + items = layout } local make_display = function(entry) @@ -890,12 +891,10 @@ function make_entry.gen_from_lsp_diagnostics(opts) string.format("%s %s", signs[entry.type], pos), string.format("LspDiagnosticsDefault%s", entry.type) } - -- remove line break to avoid display issues - local text = string.format("%-" .. line_width .."s", entry.text:gsub(".* | ", ""):gsub("[\n]", "")) return displayer { line_info, - text, + entry.text, filename, } end @@ -912,7 +911,6 @@ function make_entry.gen_from_lsp_diagnostics(opts) or '' ) .. ' ' .. entry.text, display = make_display, - bufnr = entry.bufnr, filename = filename, type = entry.type, lnum = entry.lnum, |
