|
@@ -512,8 +512,15 @@ void TextEditor::paint_event(PaintEvent& event)
|
|
|
|
|
|
size_t visual_line_index = 0;
|
|
|
for_each_visual_line(line_index, [&](Gfx::IntRect const& visual_line_rect, auto& visual_line_text, size_t start_of_visual_line, [[maybe_unused]] bool is_last_visual_line) {
|
|
|
- if (is_multi_line() && line_index == m_cursor.line() && is_cursor_line_highlighted())
|
|
|
- painter.fill_rect(visual_line_rect, widget_background_color.darkened(0.9f));
|
|
|
+ if (is_focused() && is_multi_line() && line_index == m_cursor.line() && is_cursor_line_highlighted()) {
|
|
|
+ Gfx::IntRect visible_content_line_rect {
|
|
|
+ visible_content_rect().x(),
|
|
|
+ visual_line_rect.y(),
|
|
|
+ widget_inner_rect().width() - gutter_ruler_width,
|
|
|
+ line_height()
|
|
|
+ };
|
|
|
+ painter.fill_rect(visible_content_line_rect, widget_background_color.darkened(0.9f));
|
|
|
+ }
|
|
|
if constexpr (TEXTEDITOR_DEBUG)
|
|
|
painter.draw_rect(visual_line_rect, Color::Cyan);
|
|
|
|