Skip to content

Commit 28af3f6

Browse files
saulbertclaude
andcommitted
[hlsearch] add note about two-attribute highlight model #2861
Traced through code and confirmed clear_search() always wipes both scopes before setting a new pattern, so the or in drawRow never chooses between two live patterns. Left a comment for future readers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1daac94 commit 28af3f6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

visidata/features/hlsearch.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
import re
44

55

6+
# NOTE: both Sheet and Column have highlight_regex, but g/ sets per-column
7+
# (not sheet-level), so sheet.highlight_regex is only used by highlight-sheet.
8+
# clear_search() always wipes both before any new pattern is set, so the
9+
# `col.highlight_regex or sheet.highlight_regex` in drawRow() never chooses
10+
# between two live patterns. The two-attribute model seems like it could be simplified to
11+
# one. See PR #2861 for discussion.
612
TableSheet.init('highlight_regex', lambda: None, copy=False)
713
Column.init('highlight_regex', lambda: None, copy=False)
814

0 commit comments

Comments
 (0)