mirror of https://github.com/tstack/lnav.git
parent
bfa8ae2c42
commit
116b40f28c
|
@ -69,21 +69,16 @@ bottom_status_source::update_line_number(listview_curses* lc)
|
|||
sf.set_value(" L%'d", (int) lc->get_top());
|
||||
}
|
||||
|
||||
if (lc->get_inner_height() > 0) {
|
||||
std::vector<attr_line_t> rows(1);
|
||||
|
||||
lc->get_data_source()->listview_value_for_rows(
|
||||
*lc, lc->get_top(), rows);
|
||||
const auto& sa = rows[0].get_attrs();
|
||||
auto error_wrapper = get_string_attr(sa, SA_ERROR);
|
||||
if (error_wrapper) {
|
||||
this->bss_line_error.set_value(error_wrapper.value().get());
|
||||
} else {
|
||||
this->bss_line_error.clear();
|
||||
}
|
||||
} else {
|
||||
this->bss_line_error.clear();
|
||||
}
|
||||
this->bss_line_error.set_value(
|
||||
lc->map_top_row([](const attr_line_t& top_row)
|
||||
-> nonstd::optional<std::string> {
|
||||
const auto& sa = top_row.get_attrs();
|
||||
auto error_wrapper = get_string_attr(sa, SA_ERROR);
|
||||
if (error_wrapper) {
|
||||
return error_wrapper.value().get();
|
||||
}
|
||||
return nonstd::nullopt;
|
||||
}).value_or(""));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -244,7 +244,7 @@ public:
|
|||
auto map_top_row(F func) ->
|
||||
typename std::result_of<F(const attr_line_t&)>::type
|
||||
{
|
||||
if (this->get_inner_height() == 0) {
|
||||
if (this->lv_top >= this->get_inner_height()) {
|
||||
return nonstd::nullopt;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue