Skip to content

Commit ae47b93

Browse files
Yukaiiclaude
andcommitted
refactor: remove TerminalUI dependency from highlighters
Instead of checking TerminalUI state to skip drawing the primary cursor, users can now set PrimaryCursor and PrimaryCursorEol faces to default,default to achieve the same effect. This approach: - Removes coupling between highlighters and TerminalUI - Gives users more control over cursor appearance - Keeps highlighting system focused on its core responsibility - Opens door for more effects based on primary cursor face 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 6a19bb0 commit ae47b93

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/highlighters.cc

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "regex.hh"
1717
#include "register_manager.hh"
1818
#include "string.hh"
19-
#include "terminal_ui.hh"
2019
#include "utf8.hh"
2120
#include "utf8_iterator.hh"
2221
#include "window.hh"
@@ -1291,20 +1290,11 @@ void highlight_selections(HighlightContext context, DisplayBuffer& display_buffe
12911290
highlight_range(display_buffer, begin, end, false,
12921291
apply_face(sel_faces[primary ? 0 : 1]));
12931292
}
1294-
// Check if we should skip drawing the primary cursor (for terminal cursor native mode)
1295-
const bool skip_primary_cursor = TerminalUI::has_instance() &&
1296-
TerminalUI::instance().is_cursor_native();
1297-
12981293
for (size_t i = 0; i < selections.size(); ++i)
12991294
{
13001295
auto& sel = selections[i];
13011296
const BufferCoord coord = sel.cursor();
13021297
const bool primary = (i == selections.main_index());
1303-
1304-
// Skip drawing primary cursor if terminal_cursor_native is enabled
1305-
if (primary && skip_primary_cursor)
1306-
continue;
1307-
13081298
const bool eol = buffer[coord.line].length() - 1 == coord.column;
13091299
highlight_range(display_buffer, coord, buffer.char_next(coord), false,
13101300
apply_face(sel_faces[2 + (eol ? 2 : 0) + (primary ? 0 : 1)]));

0 commit comments

Comments
 (0)