comparison mcabber/src/screen.c @ 370:dd9e2eb52916

Add /buffer search_{backward,forward}
author Mikael Berthe <mikael@lilotux.net>
date Sun, 24 Jul 2005 22:56:42 +0100
parents 499170ed71c9
children af2f8ddf6a1b
comparison
equal deleted inserted replaced
369:499170ed71c9 370:dd9e2eb52916
1003 // Finished :) 1003 // Finished :)
1004 update_panels(); 1004 update_panels();
1005 doupdate(); 1005 doupdate();
1006 } 1006 }
1007 1007
1008 // scr_BufferSearch(direction, text)
1009 // Jump to the next line containing text
1010 // (backward search if direction == -1, forward if topbottom == 1)
1011 void scr_BufferSearch(int direction, const char *text)
1012 {
1013 window_entry_t *win_entry;
1014 GList *current_line, *search_res;
1015
1016 // Get win_entry
1017 if (!current_buddy) return;
1018 win_entry = scr_SearchWindow(CURRENT_JID);
1019 if (!win_entry) return;
1020
1021 if (win_entry->top)
1022 current_line = win_entry->top;
1023 else
1024 current_line = g_list_last(win_entry->hbuf);
1025
1026 search_res = hbuf_search(current_line, direction, text);
1027
1028 if (search_res) {
1029 win_entry->cleared = FALSE;
1030 win_entry->top = search_res;
1031
1032 // Refresh the window
1033 scr_UpdateWindow(win_entry);
1034
1035 // Finished :)
1036 update_panels();
1037 doupdate();
1038 } else
1039 scr_LogPrint("Search string not found");
1040 }
1041
1008 // scr_LogPrint(...) 1042 // scr_LogPrint(...)
1009 // Display a message in the log window. 1043 // Display a message in the log window.
1010 void scr_LogPrint(const char *fmt, ...) 1044 void scr_LogPrint(const char *fmt, ...)
1011 { 1045 {
1012 time_t timestamp; 1046 time_t timestamp;