mirror of
https://github.com/tstack/lnav
synced 2024-11-17 15:29:40 +00:00
[listview] set_selection() wasn't checking if the view was selectable
Fixes #1263
This commit is contained in:
parent
f9c49712c6
commit
4fd6b62380
@ -45,7 +45,11 @@ using namespace std::chrono_literals;
|
|||||||
|
|
||||||
list_gutter_source listview_curses::DEFAULT_GUTTER_SOURCE;
|
list_gutter_source listview_curses::DEFAULT_GUTTER_SOURCE;
|
||||||
|
|
||||||
listview_curses::listview_curses() : lv_scroll(noop_func{}) {}
|
listview_curses::
|
||||||
|
listview_curses()
|
||||||
|
: lv_scroll(noop_func{})
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
listview_curses::contains(int x, int y) const
|
listview_curses::contains(int x, int y) const
|
||||||
@ -1109,6 +1113,13 @@ listview_curses::set_selection_without_context(vis_line_t sel)
|
|||||||
void
|
void
|
||||||
listview_curses::set_selection(vis_line_t sel)
|
listview_curses::set_selection(vis_line_t sel)
|
||||||
{
|
{
|
||||||
|
if (!this->lv_selectable) {
|
||||||
|
if (sel >= 0_vl) {
|
||||||
|
this->set_top(sel);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
auto dim = this->get_dimensions();
|
auto dim = this->get_dimensions();
|
||||||
auto diff = std::optional<vis_line_t>{};
|
auto diff = std::optional<vis_line_t>{};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user