summaryrefslogtreecommitdiffstats
path: root/htop.c
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2010-11-20 20:00:31 +0000
committerHisham Muhammad <hisham@gobolinux.org>2010-11-20 20:00:31 +0000
commit0ff54ebac98ed533237405aef627578751903d8d (patch)
tree486fee5fa12178343da4548cb5513909448bf52c /htop.c
parentd82e31be24281c7199e271ccdc03f29b562313d8 (diff)
Fix search by process name when processes are filtered by user. Closes #2803481.
Diffstat (limited to 'htop.c')
-rw-r--r--htop.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/htop.c b/htop.c
index 0e7a84bd..79373894 100644
--- a/htop.c
+++ b/htop.c
@@ -436,14 +436,14 @@ int main(int argc, char** argv) {
if (incSearchMode) {
doRefresh = false;
+ int size = Panel_size(panel);
if (ch == KEY_F(3)) {
int here = Panel_getSelectedIndex(panel);
- int size = ProcessList_size(pl);
int i = here+1;
while (i != here) {
if (i == size)
i = 0;
- Process* p = ProcessList_get(pl, i);
+ Process* p = (Process*) Panel_get(panel, i);
if (String_contains_i(p->comm, incSearchBuffer)) {
Panel_setSelected(panel, i);
break;
@@ -465,8 +465,8 @@ int main(int argc, char** argv) {
}
bool found = false;
- for (int i = 0; i < ProcessList_size(pl); i++) {
- Process* p = ProcessList_get(pl, i);
+ for (int i = 0; i < size; i++) {
+ Process* p = (Process*) Panel_get(panel, i);
if (String_contains_i(p->comm, incSearchBuffer)) {
Panel_setSelected(panel, i);
found = true;
@@ -477,7 +477,6 @@ int main(int argc, char** argv) {
FunctionBar_draw(searchBar, incSearchBuffer);
else
FunctionBar_drawAttr(searchBar, incSearchBuffer, CRT_colors[FAILED_SEARCH]);
-
continue;
}
if (isdigit((char)ch)) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy