Skip to content

Commit 61bf3e8

Browse files
committed
[attr_line] always hide SA_REPLACED ranges
1 parent 78b4827 commit 61bf3e8

4 files changed

Lines changed: 5 additions & 9 deletions

File tree

src/base/attr_line.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,12 @@ attr_line_t::nearest_text(size_t x) const
715715
}
716716

717717
void
718-
attr_line_t::apply_hide()
718+
attr_line_t::apply_hide(bool enabled)
719719
{
720720
auto& sa = this->al_attrs;
721721

722722
for (auto& sattr : sa) {
723-
if (sattr.sa_type == &SA_HIDDEN) {
723+
if (enabled && sattr.sa_type == &SA_HIDDEN) {
724724
auto icon = sattr.sa_value.get<ui_icon_t>();
725725
auto& lr = sattr.sa_range;
726726

src/base/attr_line.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ public:
703703

704704
attr_line_t& wrap_with(text_wrap_settings* tws);
705705

706-
void apply_hide();
706+
void apply_hide(bool enabled);
707707

708708
attr_line_t& highlight_fuzzy_matches(const std::string& pattern);
709709

src/textview_curses.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -936,9 +936,7 @@ textview_curses::textview_value_for_row(vis_line_t row, attr_line_t& value_out)
936936
this->apply_highlights(value_out, body, orig_line);
937937
}
938938

939-
if (this->tc_hide_fields) {
940-
value_out.apply_hide();
941-
}
939+
value_out.apply_hide(this->tc_hide_fields);
942940

943941
const auto& user_marks = this->tc_bookmarks[&BM_USER];
944942
const auto& user_expr_marks = this->tc_bookmarks[&BM_USER_EXPR];

src/view_helpers.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,7 @@ open_pretty_view()
460460
require_ge(al.al_string.length(), orig_lr.lr_end);
461461
}
462462
scrub_ansi_string(al.get_string(), &al.get_attrs());
463-
if (log_tc->get_hide_fields()) {
464-
al.apply_hide();
465-
}
463+
al.apply_hide(log_tc->get_hide_fields());
466464

467465
const auto orig_lr
468466
= find_string_attr_range(al.get_attrs(), &SA_ORIGINAL_LINE);

0 commit comments

Comments
 (0)