Skip to content

Commit

Permalink
feat: indent lines
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Apr 21, 2021
1 parent ff9fd51 commit f9e6930
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lua/trouble/colors.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ local links = {
FoldIcon = "CursorLineNr",
Normal = "Normal",
Count = "TabLineSel",
Preview = "Search"
Preview = "Search",
Indent = "LineNr"
}

function M.setup()
Expand Down
1 change: 1 addition & 0 deletions lua/trouble/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ local defaults = {
p = "preview",
P = "toggle_preview"
},
indent_lines = false,
auto_open = false,
auto_close = true,
auto_preview = false,
Expand Down
8 changes: 6 additions & 2 deletions lua/trouble/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f9e6930

Please sign in to comment.