1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 07:46:38 +02:00

Added color for input text not found in buffer history

This commit is contained in:
Sebastien Helleu
2007-04-04 14:04:42 +00:00
parent 3e6e347d13
commit 0e785fe106
36 changed files with 3836 additions and 3706 deletions
+2 -1
View File
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2007-03-29
ChangeLog - 2007-04-04
Version 0.2.5 (under dev!):
* added color for input text not found in buffer history
* fixed USER message when connecting to IRC server (patch #5835)
Version 0.2.4 (2007-03-29):
+7
View File
@@ -551,6 +551,13 @@
<entry>'cyan'</entry>
<entry>Farbe des Trennzeichens in der Eingabezeile</entry>
</row>
<row>
<entry><option>col_input_text_not_found</option></entry>
<entry>Farbe</entry>
<entry>Curses- oder Gtk-Farben</entry>
<entry>'red'</entry>
<entry>Color for text not found</entry>
</row>
<row>
<entry><option>col_input_bg</option></entry>
<entry>Farbe</entry>
+7
View File
@@ -551,6 +551,13 @@
<entry>'cyan'</entry>
<entry>Color for input text (delimiters)</entry>
</row>
<row>
<entry><option>col_input_text_not_found</option></entry>
<entry>color</entry>
<entry>Curses or Gtk color</entry>
<entry>'red'</entry>
<entry>Color for text not found</entry>
</row>
<row>
<entry><option>col_input_bg</option></entry>
<entry>color</entry>
+7
View File
@@ -551,6 +551,13 @@
<entry>'cyan'</entry>
<entry>Couleur pour le texte saisi (délimiteurs)</entry>
</row>
<row>
<entry><option>col_input_text_not_found</option></entry>
<entry>couleur</entry>
<entry>couleur Curses ou Gtk</entry>
<entry>'red'</entry>
<entry>Couleur pour le texte non trouvé</entry>
</row>
<row>
<entry><option>col_input_bg</option></entry>
<entry>couleur</entry>
+266 -263
View File
File diff suppressed because it is too large Load Diff
+266 -263
View File
File diff suppressed because it is too large Load Diff
+266 -263
View File
File diff suppressed because it is too large Load Diff
+266 -264
View File
File diff suppressed because it is too large Load Diff
+266 -263
View File
File diff suppressed because it is too large Load Diff
+266 -263
View File
File diff suppressed because it is too large Load Diff
+262 -263
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -317,6 +317,7 @@ int cfg_col_input_server;
int cfg_col_input_channel;
int cfg_col_input_nick;
int cfg_col_input_delimiters;
int cfg_col_input_text_not_found;
int cfg_col_input_bg;
int cfg_col_nick;
int cfg_col_nick_away;
@@ -509,6 +510,10 @@ t_config_option weechat_options_colors[] =
N_("color for input text (delimiters)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"cyan", NULL, &cfg_col_input_delimiters, NULL, &config_change_color },
{ "col_input_text_not_found", N_("color for text not found"),
N_("color for text not found"),
OPTION_TYPE_COLOR, 0, 0, 0,
"red", NULL, &cfg_col_input_text_not_found, NULL, &config_change_color },
{ "col_input_bg", N_("background for input window"),
N_("background for input window"),
OPTION_TYPE_COLOR, 0, 0, 0,
+1
View File
@@ -166,6 +166,7 @@ extern int cfg_col_input_server;
extern int cfg_col_input_channel;
extern int cfg_col_input_nick;
extern int cfg_col_input_delimiters;
extern int cfg_col_input_text_not_found;
extern int cfg_col_input_bg;
extern int cfg_col_nick;
extern int cfg_col_nick_away;
+1
View File
@@ -535,6 +535,7 @@ gui_color_init_weechat ()
gui_color[COLOR_WIN_INPUT_CHANNEL] = gui_color_build (COLOR_WIN_INPUT_CHANNEL, cfg_col_input_channel, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_NICK] = gui_color_build (COLOR_WIN_INPUT_NICK, cfg_col_input_nick, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_DELIMITERS] = gui_color_build (COLOR_WIN_INPUT_DELIMITERS, cfg_col_input_delimiters, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_TEXT_NOT_FOUND] = gui_color_build (COLOR_WIN_INPUT_TEXT_NOT_FOUND, cfg_col_input_text_not_found, cfg_col_input_bg);
gui_color[COLOR_WIN_NICK] = gui_color_build (COLOR_WIN_NICK, cfg_col_nick, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_AWAY] = gui_color_build (COLOR_WIN_NICK_AWAY, cfg_col_nick_away, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_CHANOWNER] = gui_color_build (COLOR_WIN_NICK_CHANOWNER, cfg_col_nick_chanowner, cfg_col_nick_bg);
+21 -9
View File
@@ -284,6 +284,15 @@ gui_input_draw_text (t_gui_window *window, int input_width)
count_cursor = window->buffer->input_buffer_pos -
window->buffer->input_buffer_1st_display;
offset_cursor = 0;
if (window->buffer->text_search != TEXT_SEARCH_DISABLED)
{
if (window->buffer->text_search_found)
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT);
else
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT_TEXT_NOT_FOUND);
}
while ((input_width > 0) && ptr_start && ptr_start[0])
{
ptr_next = utf8_next_char (ptr_start);
@@ -292,18 +301,21 @@ gui_input_draw_text (t_gui_window *window, int input_width)
saved_char = ptr_next[0];
ptr_next[0] = '\0';
size = ptr_next - ptr_start;
if (window->buffer->input_buffer_color_mask[pos_mask] != ' ')
color = window->buffer->input_buffer_color_mask[pos_mask] - '0';
else
color = -1;
if (color != last_color)
if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
{
if (color == -1)
gui_window_set_weechat_color (GUI_CURSES(window)->win_input, COLOR_WIN_INPUT);
if (window->buffer->input_buffer_color_mask[pos_mask] != ' ')
color = window->buffer->input_buffer_color_mask[pos_mask] - '0';
else
gui_input_set_color (window, color);
color = -1;
if (color != last_color)
{
if (color == -1)
gui_window_set_weechat_color (GUI_CURSES(window)->win_input, COLOR_WIN_INPUT);
else
gui_input_set_color (window, color);
}
last_color = color;
}
last_color = color;
output = weechat_iconv_from_internal (NULL, ptr_start);
wprintw (GUI_CURSES(window)->win_input, "%s", (output) ? output : ptr_start);
if (output)
+7 -1
View File
@@ -210,6 +210,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
/* text search */
new_buffer->text_search = TEXT_SEARCH_DISABLED;
new_buffer->text_search_exact = 0;
new_buffer->text_search_found = 0;
new_buffer->text_search_input = NULL;
/* add buffer to buffers queue */
@@ -1082,6 +1083,7 @@ gui_buffer_search_start (t_gui_window *window)
{
window->buffer->text_search = TEXT_SEARCH_BACKWARD;
window->buffer->text_search_exact = 0;
window->buffer->text_search_found = 0;
if (window->buffer->text_search_input)
{
free (window->buffer->text_search_input);
@@ -1106,11 +1108,15 @@ gui_buffer_search_restart (t_gui_window *window)
window->start_line = NULL;
window->start_line_pos = 0;
window->buffer->text_search = TEXT_SEARCH_BACKWARD;
if (!gui_buffer_search_text (window))
window->buffer->text_search_found = 0;
if (gui_buffer_search_text (window))
window->buffer->text_search_found = 1;
else
{
gui_chat_draw (window->buffer, 1);
gui_status_draw (window->buffer, 1);
}
gui_input_draw (window->buffer, 0);
}
/*
+1
View File
@@ -129,6 +129,7 @@ struct t_gui_buffer
/* text search */
int text_search; /* text search type */
int text_search_exact; /* exact search (case sensitive) ? */
int text_search_found; /* 1 if text found, otherwise 0 */
char *text_search_input; /* input saved before text search */
/* link to previous/next buffer */
+1
View File
@@ -90,6 +90,7 @@ enum t_weechat_color
COLOR_DCC_ABORTED,
COLOR_WIN_INPUT_SERVER,
COLOR_WIN_TITLE_MORE,
COLOR_WIN_INPUT_TEXT_NOT_FOUND,
GUI_NUM_COLORS
};
+2 -1
View File
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2007-03-29
ChangeLog - 2007-04-04
Version 0.2.5 (under dev!):
* added color for input text not found in buffer history
* fixed USER message when connecting to IRC server (patch #5835)
Version 0.2.4 (2007-03-29):
+7
View File
@@ -551,6 +551,13 @@
<entry>'cyan'</entry>
<entry>Farbe des Trennzeichens in der Eingabezeile</entry>
</row>
<row>
<entry><option>col_input_text_not_found</option></entry>
<entry>Farbe</entry>
<entry>Curses- oder Gtk-Farben</entry>
<entry>'red'</entry>
<entry>Color for text not found</entry>
</row>
<row>
<entry><option>col_input_bg</option></entry>
<entry>Farbe</entry>
+7
View File
@@ -551,6 +551,13 @@
<entry>'cyan'</entry>
<entry>Color for input text (delimiters)</entry>
</row>
<row>
<entry><option>col_input_text_not_found</option></entry>
<entry>color</entry>
<entry>Curses or Gtk color</entry>
<entry>'red'</entry>
<entry>Color for text not found</entry>
</row>
<row>
<entry><option>col_input_bg</option></entry>
<entry>color</entry>
+7
View File
@@ -551,6 +551,13 @@
<entry>'cyan'</entry>
<entry>Couleur pour le texte saisi (délimiteurs)</entry>
</row>
<row>
<entry><option>col_input_text_not_found</option></entry>
<entry>couleur</entry>
<entry>couleur Curses ou Gtk</entry>
<entry>'red'</entry>
<entry>Couleur pour le texte non trouvé</entry>
</row>
<row>
<entry><option>col_input_bg</option></entry>
<entry>couleur</entry>
+266 -263
View File
File diff suppressed because it is too large Load Diff
+266 -263
View File
File diff suppressed because it is too large Load Diff
+266 -263
View File
File diff suppressed because it is too large Load Diff
+266 -264
View File
File diff suppressed because it is too large Load Diff
+266 -263
View File
File diff suppressed because it is too large Load Diff
+266 -263
View File
File diff suppressed because it is too large Load Diff
+262 -263
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -317,6 +317,7 @@ int cfg_col_input_server;
int cfg_col_input_channel;
int cfg_col_input_nick;
int cfg_col_input_delimiters;
int cfg_col_input_text_not_found;
int cfg_col_input_bg;
int cfg_col_nick;
int cfg_col_nick_away;
@@ -509,6 +510,10 @@ t_config_option weechat_options_colors[] =
N_("color for input text (delimiters)"),
OPTION_TYPE_COLOR, 0, 0, 0,
"cyan", NULL, &cfg_col_input_delimiters, NULL, &config_change_color },
{ "col_input_text_not_found", N_("color for text not found"),
N_("color for text not found"),
OPTION_TYPE_COLOR, 0, 0, 0,
"red", NULL, &cfg_col_input_text_not_found, NULL, &config_change_color },
{ "col_input_bg", N_("background for input window"),
N_("background for input window"),
OPTION_TYPE_COLOR, 0, 0, 0,
+1
View File
@@ -166,6 +166,7 @@ extern int cfg_col_input_server;
extern int cfg_col_input_channel;
extern int cfg_col_input_nick;
extern int cfg_col_input_delimiters;
extern int cfg_col_input_text_not_found;
extern int cfg_col_input_bg;
extern int cfg_col_nick;
extern int cfg_col_nick_away;
@@ -535,6 +535,7 @@ gui_color_init_weechat ()
gui_color[COLOR_WIN_INPUT_CHANNEL] = gui_color_build (COLOR_WIN_INPUT_CHANNEL, cfg_col_input_channel, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_NICK] = gui_color_build (COLOR_WIN_INPUT_NICK, cfg_col_input_nick, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_DELIMITERS] = gui_color_build (COLOR_WIN_INPUT_DELIMITERS, cfg_col_input_delimiters, cfg_col_input_bg);
gui_color[COLOR_WIN_INPUT_TEXT_NOT_FOUND] = gui_color_build (COLOR_WIN_INPUT_TEXT_NOT_FOUND, cfg_col_input_text_not_found, cfg_col_input_bg);
gui_color[COLOR_WIN_NICK] = gui_color_build (COLOR_WIN_NICK, cfg_col_nick, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_AWAY] = gui_color_build (COLOR_WIN_NICK_AWAY, cfg_col_nick_away, cfg_col_nick_bg);
gui_color[COLOR_WIN_NICK_CHANOWNER] = gui_color_build (COLOR_WIN_NICK_CHANOWNER, cfg_col_nick_chanowner, cfg_col_nick_bg);
+21 -9
View File
@@ -284,6 +284,15 @@ gui_input_draw_text (t_gui_window *window, int input_width)
count_cursor = window->buffer->input_buffer_pos -
window->buffer->input_buffer_1st_display;
offset_cursor = 0;
if (window->buffer->text_search != TEXT_SEARCH_DISABLED)
{
if (window->buffer->text_search_found)
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT);
else
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
COLOR_WIN_INPUT_TEXT_NOT_FOUND);
}
while ((input_width > 0) && ptr_start && ptr_start[0])
{
ptr_next = utf8_next_char (ptr_start);
@@ -292,18 +301,21 @@ gui_input_draw_text (t_gui_window *window, int input_width)
saved_char = ptr_next[0];
ptr_next[0] = '\0';
size = ptr_next - ptr_start;
if (window->buffer->input_buffer_color_mask[pos_mask] != ' ')
color = window->buffer->input_buffer_color_mask[pos_mask] - '0';
else
color = -1;
if (color != last_color)
if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
{
if (color == -1)
gui_window_set_weechat_color (GUI_CURSES(window)->win_input, COLOR_WIN_INPUT);
if (window->buffer->input_buffer_color_mask[pos_mask] != ' ')
color = window->buffer->input_buffer_color_mask[pos_mask] - '0';
else
gui_input_set_color (window, color);
color = -1;
if (color != last_color)
{
if (color == -1)
gui_window_set_weechat_color (GUI_CURSES(window)->win_input, COLOR_WIN_INPUT);
else
gui_input_set_color (window, color);
}
last_color = color;
}
last_color = color;
output = weechat_iconv_from_internal (NULL, ptr_start);
wprintw (GUI_CURSES(window)->win_input, "%s", (output) ? output : ptr_start);
if (output)
+7 -1
View File
@@ -210,6 +210,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
/* text search */
new_buffer->text_search = TEXT_SEARCH_DISABLED;
new_buffer->text_search_exact = 0;
new_buffer->text_search_found = 0;
new_buffer->text_search_input = NULL;
/* add buffer to buffers queue */
@@ -1082,6 +1083,7 @@ gui_buffer_search_start (t_gui_window *window)
{
window->buffer->text_search = TEXT_SEARCH_BACKWARD;
window->buffer->text_search_exact = 0;
window->buffer->text_search_found = 0;
if (window->buffer->text_search_input)
{
free (window->buffer->text_search_input);
@@ -1106,11 +1108,15 @@ gui_buffer_search_restart (t_gui_window *window)
window->start_line = NULL;
window->start_line_pos = 0;
window->buffer->text_search = TEXT_SEARCH_BACKWARD;
if (!gui_buffer_search_text (window))
window->buffer->text_search_found = 0;
if (gui_buffer_search_text (window))
window->buffer->text_search_found = 1;
else
{
gui_chat_draw (window->buffer, 1);
gui_status_draw (window->buffer, 1);
}
gui_input_draw (window->buffer, 0);
}
/*
+1
View File
@@ -129,6 +129,7 @@ struct t_gui_buffer
/* text search */
int text_search; /* text search type */
int text_search_exact; /* exact search (case sensitive) ? */
int text_search_found; /* 1 if text found, otherwise 0 */
char *text_search_input; /* input saved before text search */
/* link to previous/next buffer */
+1
View File
@@ -90,6 +90,7 @@ enum t_weechat_color
COLOR_DCC_ABORTED,
COLOR_WIN_INPUT_SERVER,
COLOR_WIN_TITLE_MORE,
COLOR_WIN_INPUT_TEXT_NOT_FOUND,
GUI_NUM_COLORS
};