Skip to content

Commit 7e03589

Browse files
committed
[log-view] mention that indexing is happening
1 parent e0dbff8 commit 7e03589

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/field_overlay_source.cc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,15 @@ field_overlay_source::list_static_overlay(const listview_curses& lv,
779779
{
780780
const std::vector<attr_line_t>* lines = nullptr;
781781
if (this->fos_lss.text_line_count() == 0) {
782-
if (this->fos_lss.file_count() > 0) {
782+
if (this->fos_lss.is_indexing_in_progress()
783+
|| this->fos_lss.is_rebuild_forced())
784+
{
785+
auto msg = lnav::console::user_message::info(
786+
"Log messages are being indexed...");
787+
this->fos_static_lines = msg.to_attr_line().split_lines();
788+
this->fos_static_lines_state.clear();
789+
lines = &this->fos_static_lines;
790+
} else if (this->fos_lss.file_count() > 0) {
783791
hasher h;
784792
this->fos_lss.update_filter_hash_state(h);
785793
auto curr_state = h.to_array();

src/lnav.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,9 @@ struct refresh_status_bars {
10321032
prompt.p_editor.set_inactive_value(cancel_msg);
10331033
}
10341034

1035-
if (!lnav_data.ld_log_source.is_indexing_in_progress()) {
1035+
if (!lnav_data.ld_log_source.is_indexing_in_progress()
1036+
|| lnav_data.ld_log_source.text_line_count() == 0)
1037+
{
10361038
lnav_data.ld_view_stack.do_update();
10371039
}
10381040
if (this->rsb_top_source->update_time(current_time)) {

src/logfile_sub_source.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,8 @@ public:
272272

273273
void set_force_rebuild() { this->lss_force_rebuild = true; }
274274

275+
bool is_rebuild_forced() const { return this->lss_force_rebuild; }
276+
275277
void set_min_log_level(log_level_t level)
276278
{
277279
if (this->lss_min_log_level != level) {

0 commit comments

Comments
 (0)