diff options
Diffstat (limited to 'lua/mason-core/ui/display.lua')
| -rw-r--r-- | lua/mason-core/ui/display.lua | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lua/mason-core/ui/display.lua b/lua/mason-core/ui/display.lua index 4c6a06c2..c4aebd95 100644 --- a/lua/mason-core/ui/display.lua +++ b/lua/mason-core/ui/display.lua @@ -119,15 +119,16 @@ local function render_node(viewport_context, node, _render_context, _output) end end - local active_styles = get_styles(full_line, render_context) - - -- apply indentation - full_line = (" "):rep(active_styles.indentation) .. full_line - for j = 1, #line_highlights do - local highlight = line_highlights[j] - highlight.col_start = highlight.col_start + active_styles.indentation - highlight.col_end = highlight.col_end + active_styles.indentation - output.highlights[#output.highlights + 1] = highlight + -- only apply cascading styles to non-empty lines + if string.len(full_line) > 0 then + local active_styles = get_styles(full_line, render_context) + full_line = (" "):rep(active_styles.indentation) .. full_line + for j = 1, #line_highlights do + local highlight = line_highlights[j] + highlight.col_start = highlight.col_start + active_styles.indentation + highlight.col_end = highlight.col_end + active_styles.indentation + output.highlights[#output.highlights + 1] = highlight + end end output.lines[#output.lines + 1] = full_line |
