mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
Don't select last item when clicking past the end of the panel.
This commit is contained in:
parent
6082db2121
commit
3c4326b450
5
Panel.c
5
Panel.c
@ -254,7 +254,10 @@ int Panel_size(Panel* this) {
|
||||
void Panel_setSelected(Panel* this, int selected) {
|
||||
assert (this != NULL);
|
||||
|
||||
selected = MIN(Vector_size(this->items) - 1, selected);
|
||||
int size = Vector_size(this->items);
|
||||
if (selected >= size) {
|
||||
return;
|
||||
}
|
||||
if (selected < 0)
|
||||
selected = 0;
|
||||
this->selected = selected;
|
||||
|
Loading…
Reference in New Issue
Block a user