diff --git a/lib/bds/tui.ex b/lib/bds/tui.ex index 0dd2f4e..4cf41de 100644 --- a/lib/bds/tui.ex +++ b/lib/bds/tui.ex @@ -1474,7 +1474,10 @@ defmodule BDS.TUI do language: :markdown_macros, block: %Block{title: body_title, borders: [:all]}, cursor_style: if(focused?, do: %Style{bg: :cyan}, else: %Style{}), - line_highlight_style: if(focused?, do: %Style{bg: :dark_gray}, else: %Style{}) + # base16-ocean's lighter-background grey — a fixed RGB so the + # current-line marker stays dark (and readable) in any terminal + # palette, unlike the named :dark_gray colour. + line_highlight_style: if(focused?, do: %Style{bg: {:rgb, 52, 61, 70}}, else: %Style{}) }, body_rect} end diff --git a/test/bds/tui_test.exs b/test/bds/tui_test.exs index 92cd5b4..a746eda 100644 --- a/test/bds/tui_test.exs +++ b/test/bds/tui_test.exs @@ -154,8 +154,10 @@ defmodule BDS.TUITest do assert ExRatatui.textarea_cursor(state.editor.textarea) == {0, 5} cells = screen_cells(state) - assert cell_at_text(cells, "first").bg == :dark_gray - refute cell_at_text(cells, "second").bg == :dark_gray + # A fixed dark grey — readable against the light syntax colours in + # any terminal palette (the named :dark_gray is palette-dependent). + assert cell_at_text(cells, "first").bg == {:rgb, 52, 61, 70} + refute cell_at_text(cells, "second").bg == {:rgb, 52, 61, 70} end test "ctrl+s persists textarea edits", %{post: post} do