diff options
author | ache <ache@ache.one> | 2019-01-24 08:25:07 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2019-01-24 08:25:07 +0100 |
commit | 8ad44911e0b2ce4a01bbca94bd456dfc820e9467 (patch) | |
tree | b49c704d9f63023eda621077a1d524afc983493d | |
parent | Fix readline (diff) |
Search function
-rw-r--r-- | main.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -157,7 +157,7 @@ int main(int argc, char* argv[]){ visual_mode = true; curs_set(0); - cmd_win = newwin(1, COLS, LINES - 20, 0); + cmd_win = newwin(1, COLS, LINES - 1, 0); sep_win = newwin(1, COLS, LINES - 2, 0); init_pair( 12, COLOR_WHITE, COLOR_BLUE); @@ -236,6 +236,22 @@ int main(int argc, char* argv[]){ if( currentConv ) tabed = !tabed; break; + case '/': // Search by name + if( !tabed ) { + contact* found = NULL; + move(LINES-1,0); + readline_n(); + int r = findContactFromName(msg_win_str, &found); + + if( r == 0 ) { + setContactSelection(found); + } else { + printf("[%d]%s\n", r, msg_win_str); + } + curs_set(0); + showContactListW(); + } + break; case 'n': showName = !showName; showContactListW(); @@ -247,6 +263,7 @@ int main(int argc, char* argv[]){ resize(); } break; + case 'i': case 's': { char* number = NULL; |