From f9e6930b5188593b9e6408d8937093d04198e90a Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Thu, 22 Apr 2021 01:13:34 +0200 Subject: [PATCH] feat: indent lines --- lua/trouble/colors.lua | 3 ++- lua/trouble/config.lua | 1 + lua/trouble/renderer.lua | 8 ++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lua/trouble/colors.lua b/lua/trouble/colors.lua index 38135172..89f7ac58 100644 --- a/lua/trouble/colors.lua +++ b/lua/trouble/colors.lua @@ -21,7 +21,8 @@ local links = { FoldIcon = "CursorLineNr", Normal = "Normal", Count = "TabLineSel", - Preview = "Search" + Preview = "Search", + Indent = "LineNr" } function M.setup() diff --git a/lua/trouble/config.lua b/lua/trouble/config.lua index 72305708..1b34035f 100644 --- a/lua/trouble/config.lua +++ b/lua/trouble/config.lua @@ -17,6 +17,7 @@ local defaults = { p = "preview", P = "toggle_preview" }, + indent_lines = false, auto_open = false, auto_close = true, auto_preview = false, diff --git a/lua/trouble/renderer.lua b/lua/trouble/renderer.lua index e863f8b5..9ab2df7d 100644 --- a/lua/trouble/renderer.lua +++ b/lua/trouble/renderer.lua @@ -96,9 +96,13 @@ function renderer.render_diagnostics(view, text, items) local sign = signs[string.lower(diag.type)] if not sign then sign = diag.type end - text:render(" " .. sign .. " ", "Sign" .. diag.type) + local indent = " " + if config.options.indent_lines then indent = " │ " end + + text:render(indent, "Indent") + text:render(sign .. " ", "Sign" .. diag.type) text:render(diag.text, "Text" .. diag.type, " ") - text:render(diag.type, diag.type, " ") + -- text:render(diag.type, diag.type, " ") if diag.source then text:render(diag.source, "Source", " ") end if diag.code then