Mercurial > hg
diff mcabber/src/screen.c @ 462:d580e87c11ed
Add "/buffer %n"
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Thu, 29 Sep 2005 21:28:39 +0200 |
parents | 8827bbef84a1 |
children | e4840b288be0 |
line wrap: on
line diff
--- a/mcabber/src/screen.c Wed Sep 28 21:56:35 2005 +0200 +++ b/mcabber/src/screen.c Thu Sep 29 21:28:39 2005 +0200 @@ -1093,6 +1093,36 @@ scr_LogPrint(LPRINT_NORMAL, "Search string not found"); } +// scr_BufferPercent(n) +// Jump to the specified position in the buffer, in % +void scr_BufferPercent(int pc) +{ + window_entry_t *win_entry; + GList *search_res; + + // Get win_entry + if (!current_buddy) return; + win_entry = scr_SearchWindow(CURRENT_JID); + if (!win_entry) return; + + if (pc < 0 || pc > 100) { + scr_LogPrint(LPRINT_NORMAL, "Bad % value"); + return; + } + + search_res = hbuf_jump_percent(win_entry->hbuf, pc); + + win_entry->cleared = FALSE; + win_entry->top = search_res; + + // Refresh the window + scr_UpdateWindow(win_entry); + + // Finished :) + update_panels(); + doupdate(); +} + // scr_set_chatmode() // Public function to (un)set chatmode... inline void scr_set_chatmode(int enable)