clean inc search buffer code

This commit is contained in:
Hisham Muhammad 2009-04-22 19:26:49 +00:00
parent 843aded57c
commit 510213591b
1 changed files with 3 additions and 5 deletions

8
htop.c
View File

@ -353,8 +353,6 @@ int main(int argc, char** argv) {
if (recalculate) if (recalculate)
oldTime = newTime; oldTime = newTime;
if (doRefresh) { if (doRefresh) {
incSearchIndex = 0;
incSearchBuffer[0] = 0;
int currPos = Panel_getSelectedIndex(panel); int currPos = Panel_getSelectedIndex(panel);
unsigned int currPid = 0; unsigned int currPid = 0;
int currScrollV = panel->scrollV; int currScrollV = panel->scrollV;
@ -429,8 +427,6 @@ int main(int argc, char** argv) {
incSearchBuffer[incSearchIndex] = 0; incSearchBuffer[incSearchIndex] = 0;
} else { } else {
incSearchMode = false; incSearchMode = false;
incSearchIndex = 0;
incSearchBuffer[0] = 0;
FunctionBar_draw(defaultBar, NULL); FunctionBar_draw(defaultBar, NULL);
continue; continue;
} }
@ -729,8 +725,10 @@ int main(int argc, char** argv) {
} }
case KEY_F(3): case KEY_F(3):
case '/': case '/':
FunctionBar_draw(searchBar, incSearchBuffer); incSearchIndex = 0;
incSearchBuffer[0] = 0;
incSearchMode = true; incSearchMode = true;
FunctionBar_draw(searchBar, incSearchBuffer);
break; break;
case 't': case 't':
case KEY_F(5): case KEY_F(5):