Use cursor mode for 'LOG' and 'TEXT' view

This commit is contained in:
Florian Münchbach 2022-12-11 22:01:57 +01:00
parent bd81c4382d
commit b4e625030f
2 changed files with 9 additions and 3 deletions

View File

@ -964,7 +964,7 @@ handle_paging_key(int ch)
break;
case KEY_CTRL_X:
for (int i = 0; i < LNV__MAX; ++i) {
for (auto i : {LNV_LOG, LNV_TEXT}) {
// set selection to current top, so we don't jump to 0.
auto& view = lnav_data.ld_views[i];
bool selectable = view.is_selectable();

View File

@ -2613,6 +2613,9 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
}
}
bool selectable
= (lnav_config.lc_ui_movement.mode == config_movement_mode::CURSOR);
/* If we statically linked against an ncurses library that had a non-
* standard path to the terminfo database, we need to set this variable
* so that it will try the default path.
@ -2648,8 +2651,11 @@ SELECT tbl_name FROM sqlite_master WHERE sql LIKE 'CREATE VIRTUAL TABLE%'
}))
.add_input_delegate(lnav_data.ld_log_source)
.set_tail_space(2_vl)
.set_overlay_source(log_fos);
lnav_data.ld_views[LNV_TEXT].set_sub_source(&lnav_data.ld_text_source);
.set_overlay_source(log_fos)
.set_selectable(selectable);
lnav_data.ld_views[LNV_TEXT]
.set_sub_source(&lnav_data.ld_text_source)
.set_selectable(selectable);
lnav_data.ld_views[LNV_HISTOGRAM].set_sub_source(
&lnav_data.ld_hist_source2);
lnav_data.ld_views[LNV_DB].set_sub_source(&lnav_data.ld_db_row_source);