mirror of
https://github.com/weechat/weechat.git
synced 2026-07-04 16:53:14 +02:00
Remove unused option look.input_format, fix refresh bug with input prompt for IRC buffers
This commit is contained in:
@@ -197,80 +197,6 @@ gui_input_insert_string (struct t_gui_buffer *buffer, const char *string,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_get_prompt_length: return input prompt length (displayed on screen)
|
||||
*/
|
||||
|
||||
int
|
||||
gui_input_get_prompt_length (struct t_gui_buffer *buffer)
|
||||
{
|
||||
char *pos, saved_char;
|
||||
int char_size, length;
|
||||
|
||||
if (buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
|
||||
{
|
||||
if (buffer->text_search_exact)
|
||||
return utf8_strlen_screen (_("Text search (exact): "));
|
||||
else
|
||||
return utf8_strlen_screen (_("Text search: "));
|
||||
}
|
||||
|
||||
length = 0;
|
||||
pos = CONFIG_STRING(config_look_input_format);
|
||||
while (pos && pos[0])
|
||||
{
|
||||
switch (pos[0])
|
||||
{
|
||||
case '%':
|
||||
pos++;
|
||||
switch (pos[0])
|
||||
{
|
||||
case 'c': /* buffer name */
|
||||
length += utf8_strlen_screen (buffer->name);
|
||||
pos++;
|
||||
break;
|
||||
case 'm': // nick modes
|
||||
/*if (GUI_SERVER(buffer) && GUI_SERVER(buffer)->is_connected)
|
||||
{
|
||||
if (GUI_SERVER(buffer)->nick_modes
|
||||
&& GUI_SERVER(buffer)->nick_modes[0])
|
||||
length += strlen (GUI_SERVER(buffer)->nick_modes);
|
||||
}*/
|
||||
pos++;
|
||||
break;
|
||||
case 'n': /* nick */
|
||||
if (buffer->input_nick)
|
||||
length += utf8_strlen_screen (buffer->input_nick);
|
||||
pos++;
|
||||
break;
|
||||
default:
|
||||
length++;
|
||||
if (pos[0])
|
||||
{
|
||||
if (pos[0] == '%')
|
||||
pos++;
|
||||
else
|
||||
{
|
||||
length++;
|
||||
pos += utf8_char_size (pos);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
char_size = utf8_char_size (pos);
|
||||
saved_char = pos[char_size];
|
||||
pos[char_size] = '\0';
|
||||
length += utf8_strlen_screen (pos);
|
||||
pos[char_size] = saved_char;
|
||||
pos += char_size;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return length;
|
||||
}
|
||||
|
||||
/*
|
||||
* gui_input_clipboard_copy: copy string into clipboard
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user