added format_get_length() for getting length of text part in a format

string. gui_printtext() now works like printtext_string() so %s won't
accidentally crash it. /SET prompt can now have %formats.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1273 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-02-21 04:21:15 +00:00 committed by cras
commit 4718edf055
8 changed files with 44 additions and 27 deletions

View file

@ -19,7 +19,9 @@
*/
#include "module.h"
#include "formats.h"
#include "gui-printtext.h"
#include "screen.h"
static GString *entry;
@ -78,11 +80,11 @@ void gui_entry_set_prompt(const char *str)
g_free_not_null(prompt);
prompt = g_strdup(str);
promptlen = strlen(prompt);
promptlen = format_get_length(prompt);
}
set_color(stdscr, 0);
mvaddstr(LINES-1, 0, prompt);
if (prompt != NULL)
gui_printtext(0, LINES-1, prompt);
entry_screenpos();
entry_update();
@ -94,7 +96,7 @@ void gui_entry_set_perm_prompt(const char *str)
g_free_not_null(prompt);
prompt = g_strdup(str);
promptlen = strlen(prompt);
promptlen = format_get_length(prompt);
permanent_prompt = TRUE;
gui_entry_set_prompt(NULL);