diff --git a/ChangeLog b/ChangeLog index 8994f92ab..d6d231c84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,8 @@ Version 0.3.1 (under dev!) * irc: add missing CTCP: clientinfo, finger, source, time, userinfo (task #7270) * irc: improve error management on socket error (recv/send) * xfer: add missing charset decoding/encoding for IRC DCC chat (bug #27482) +* gui: fix bug with URL selection in some terminals (caused by horizontal lines) + (bug #27700) * gui: use default auto completion for arguments of unknown commands * gui: fix alignment problem for buffer name when a merged buffer is closed (bug #27617) diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt index 2f9f23d5d..b0f8ffae0 100644 --- a/doc/en/autogen/user/weechat_options.txt +++ b/doc/en/autogen/user/weechat_options.txt @@ -388,6 +388,11 @@ ** type: string ** values: any string (default value: "") +* *weechat.look.hline_char* +** description: char used to draw horizontal lines, note that empty value will draw a real line with ncurses, but may cause bugs with URL selection under some terminals +** type: string +** values: any string (default value: "-") + * *weechat.look.hotlist_names_count* ** description: max number of names in hotlist (0 = no name displayed, only buffer numbers) ** type: integer diff --git a/doc/fr/autogen/user/weechat_options.txt b/doc/fr/autogen/user/weechat_options.txt index e8eea1db5..223bc338b 100644 --- a/doc/fr/autogen/user/weechat_options.txt +++ b/doc/fr/autogen/user/weechat_options.txt @@ -388,6 +388,11 @@ ** type: chaîne ** valeurs: toute chaîne (valeur par défaut: "") +* *weechat.look.hline_char* +** description: caractère utilisé pour tracer les lignes horizontales, notez qu'une valeur vide tracera une vraie ligne avec ncurses, mais peut causer des problèmes d'affichage avec la sélection d'URL sous certains terminaux +** type: chaîne +** valeurs: toute chaîne (valeur par défaut: "-") + * *weechat.look.hotlist_names_count* ** description: nombre maximum de noms dans la liste d'activité (0 = pas de nom affiché, seulement les numéros de tampons) ** type: entier diff --git a/po/cs.po b/po/cs.po index fc398cbdb..4c2aab952 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-10-10 12:39+0200\n" +"POT-Creation-Date: 2009-10-14 17:29+0200\n" "PO-Revision-Date: 2009-09-14 10:56+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -1502,6 +1502,11 @@ msgstr "" "čárkou oddělený seznam slov pro zvýraznění (neporovnává se velikost písmen, " "slova mohou začínat nebo končit \"*\" pro částečnou schodu)" +msgid "" +"char used to draw horizontal lines, note that empty value will draw a real " +"line with ncurses, but may cause bugs with URL selection under some terminals" +msgstr "" + msgid "" "max number of names in hotlist (0 = no name displayed, only buffer numbers)" msgstr "" diff --git a/po/de.po b/po/de.po index bd7e7266c..35f45f0be 100644 --- a/po/de.po +++ b/po/de.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-10-10 12:39+0200\n" +"POT-Creation-Date: 2009-10-14 17:29+0200\n" "PO-Revision-Date: 2009-10-03 12:07+0200\n" "Last-Translator: Thomas Schuetz \n" "Language-Team: weechat-dev \n" @@ -1338,6 +1338,11 @@ msgstr "" "Kleinschreibung wird nicht beachtet, die Wörter können mit \"*\" als Joker " "beginnen oder enden)" +msgid "" +"char used to draw horizontal lines, note that empty value will draw a real " +"line with ncurses, but may cause bugs with URL selection under some terminals" +msgstr "" + msgid "" "max number of names in hotlist (0 = no name displayed, only buffer numbers)" msgstr "" diff --git a/po/es.po b/po/es.po index 496b434f4..748423f5e 100644 --- a/po/es.po +++ b/po/es.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-10-10 12:39+0200\n" +"POT-Creation-Date: 2009-10-14 17:29+0200\n" "PO-Revision-Date: 2009-09-06 21:25+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -1310,6 +1310,11 @@ msgstr "" "mayúsculas, las palabras pueden empezar o terminar con \"*\" para una " "concordancia parcial)" +msgid "" +"char used to draw horizontal lines, note that empty value will draw a real " +"line with ncurses, but may cause bugs with URL selection under some terminals" +msgstr "" + msgid "" "max number of names in hotlist (0 = no name displayed, only buffer numbers)" msgstr "" diff --git a/po/fr.po b/po/fr.po index 17fcd93cf..61080040d 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-10-10 12:39+0200\n" -"PO-Revision-Date: 2009-10-10 12:40+0200\n" +"POT-Creation-Date: 2009-10-14 17:29+0200\n" +"PO-Revision-Date: 2009-10-14 17:30+0200\n" "Last-Translator: FlashCode \n" "Language-Team: weechat-dev \n" "MIME-Version: 1.0\n" @@ -1526,6 +1526,14 @@ msgstr "" "comparaison ne tient pas compte de la casse, les mots peuvent commencer ou " "se terminer par \"*\" pour une comparaison partielle)" +msgid "" +"char used to draw horizontal lines, note that empty value will draw a real " +"line with ncurses, but may cause bugs with URL selection under some terminals" +msgstr "" +"caractère utilisé pour tracer les lignes horizontales, notez qu'une valeur " +"vide tracera une vraie ligne avec ncurses, mais peut causer des problèmes " +"d'affichage avec la sélection d'URL sous certains terminaux" + msgid "" "max number of names in hotlist (0 = no name displayed, only buffer numbers)" msgstr "" diff --git a/po/hu.po b/po/hu.po index 93a09d582..f41e8ba4b 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-10-10 12:39+0200\n" +"POT-Creation-Date: 2009-10-14 17:29+0200\n" "PO-Revision-Date: 2009-09-20 13:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -1388,6 +1388,11 @@ msgstr "" "kiemelendő szavak vesszővel elválasztott listája (kis/nagybetűtől független " "összehasonlítás, a szavak végére/elejére \"*\"-ot illesztve részleges keresés" +msgid "" +"char used to draw horizontal lines, note that empty value will draw a real " +"line with ncurses, but may cause bugs with URL selection under some terminals" +msgstr "" + msgid "" "max number of names in hotlist (0 = no name displayed, only buffer numbers)" msgstr "" diff --git a/po/pl.po b/po/pl.po index cc477d6ca..adceaf02b 100644 --- a/po/pl.po +++ b/po/pl.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-10-10 12:39+0200\n" +"POT-Creation-Date: 2009-10-14 17:29+0200\n" "PO-Revision-Date: 2009-09-06 21:25+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: Polish\n" @@ -1534,6 +1534,11 @@ msgstr "" "wielkość znaków, słowa mogą się zaczynać lub kończyć \"*\" dla częściowego " "dopasowania)" +msgid "" +"char used to draw horizontal lines, note that empty value will draw a real " +"line with ncurses, but may cause bugs with URL selection under some terminals" +msgstr "" + msgid "" "max number of names in hotlist (0 = no name displayed, only buffer numbers)" msgstr "" diff --git a/po/ru.po b/po/ru.po index be4362cf7..dc087e3bb 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.1-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-10-10 12:39+0200\n" +"POT-Creation-Date: 2009-10-14 17:29+0200\n" "PO-Revision-Date: 2009-09-20 13:50+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -1392,6 +1392,11 @@ msgstr "" "разделённый запятыми список подсвечиваемых слов (регистр учитывается, слова " "могут начинаться или кончаться \"*\" для неполного соответствия)" +msgid "" +"char used to draw horizontal lines, note that empty value will draw a real " +"line with ncurses, but may cause bugs with URL selection under some terminals" +msgstr "" + msgid "" "max number of names in hotlist (0 = no name displayed, only buffer numbers)" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index 38193ef4e..18ffe9861 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-10-10 12:39+0200\n" +"POT-Creation-Date: 2009-10-14 17:29+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -1187,6 +1187,11 @@ msgid "" "words may begin or end with \"*\" for partial match)" msgstr "" +msgid "" +"char used to draw horizontal lines, note that empty value will draw a real " +"line with ncurses, but may cause bugs with URL selection under some terminals" +msgstr "" + msgid "" "max number of names in hotlist (0 = no name displayed, only buffer numbers)" msgstr "" diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 2b0e5c672..8c3ae6ab4 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -77,6 +77,7 @@ struct t_config_option *config_look_color_real_white; struct t_config_option *config_look_day_change; struct t_config_option *config_look_day_change_time_format; struct t_config_option *config_look_highlight; +struct t_config_option *config_look_hline_char; struct t_config_option *config_look_hotlist_names_count; struct t_config_option *config_look_hotlist_names_length; struct t_config_option *config_look_hotlist_names_level; @@ -1264,6 +1265,13 @@ config_weechat_init_options () N_("comma separated list of words to highlight (case insensitive " "comparison, words may begin or end with \"*\" for partial match)"), NULL, 0, 0, "", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + config_look_hline_char = config_file_new_option ( + weechat_config_file, ptr_section, + "hline_char", "string", + N_("char used to draw horizontal lines, note that empty value will " + "draw a real line with ncurses, but may cause bugs with URL " + "selection under some terminals"), + NULL, 0, 0, "-", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_hotlist_names_count = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_names_count", "integer", diff --git a/src/core/wee-config.h b/src/core/wee-config.h index 021a503e1..0d1a550d8 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -92,6 +92,7 @@ extern struct t_config_option *config_look_color_real_white; extern struct t_config_option *config_look_day_change; extern struct t_config_option *config_look_day_change_time_format; extern struct t_config_option *config_look_highlight; +extern struct t_config_option *config_look_hline_char; extern struct t_config_option *config_look_hotlist_names_count; extern struct t_config_option *config_look_hotlist_names_length; extern struct t_config_option *config_look_hotlist_names_level; diff --git a/src/gui/curses/gui-curses-bar-window.c b/src/gui/curses/gui-curses-bar-window.c index 768a00d9e..5e96381d1 100644 --- a/src/gui/curses/gui-curses-bar-window.c +++ b/src/gui/curses/gui-curses-bar-window.c @@ -405,7 +405,7 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, int length_on_screen, chars_available; int length_screen_before_cursor, length_screen_after_cursor; int total_length_screen, diff, max_length, optimal_number_of_lines; - int some_data_not_displayed; + int some_data_not_displayed, hline_char; if (!gui_init_ok) return; @@ -615,6 +615,8 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, wnoutrefresh (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_bar); + hline_char = gui_window_get_hline_char (); + if (CONFIG_INTEGER(bar_window->bar->options[GUI_BAR_OPTION_SEPARATOR])) { switch (CONFIG_INTEGER(bar_window->bar->options[GUI_BAR_OPTION_POSITION])) @@ -622,14 +624,16 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window, case GUI_BAR_POSITION_BOTTOM: gui_window_set_weechat_color (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, GUI_COLOR_SEPARATOR); - mvwhline (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, 0, 0, ACS_HLINE, - bar_window->width); + mvwhline (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, 0, 0, + hline_char, bar_window->width); break; case GUI_BAR_POSITION_TOP: gui_window_set_weechat_color (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, GUI_COLOR_SEPARATOR); mvwhline (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, - 0, 0, ACS_HLINE, bar_window->width); + 0, 0, + hline_char, + bar_window->width); break; case GUI_BAR_POSITION_LEFT: gui_window_set_weechat_color (GUI_BAR_WINDOW_OBJECTS(bar_window)->win_separator, diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c index aac84aad1..f4bd74224 100644 --- a/src/gui/curses/gui-curses-chat.c +++ b/src/gui/curses/gui-curses-chat.c @@ -128,7 +128,9 @@ gui_chat_display_new_line (struct t_gui_window *window, int num_lines, int count void gui_chat_display_horizontal_line (struct t_gui_window *window, int simulate) { - int i, n; + int i, n, hline_char; + + hline_char = gui_window_get_hline_char (); if (!simulate) { @@ -139,8 +141,7 @@ gui_chat_display_horizontal_line (struct t_gui_window *window, int simulate) case CONFIG_LOOK_READ_MARKER_LINE: mvwhline (GUI_WINDOW_OBJECTS(window)->win_chat, window->win_chat_cursor_y, window->win_chat_cursor_x, - ACS_HLINE, - window->win_chat_width - 1); + hline_char, window->win_chat_width - 1); break; case CONFIG_LOOK_READ_MARKER_DOTTED_LINE: wmove (GUI_WINDOW_OBJECTS(window)->win_chat, @@ -152,7 +153,7 @@ gui_chat_display_horizontal_line (struct t_gui_window *window, int simulate) if (i % 2 == n) mvwhline (GUI_WINDOW_OBJECTS(window)->win_chat, window->win_chat_cursor_y, i, - ACS_HLINE, 1); + hline_char, 1); } break; default: diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c index 2db24ab52..823969071 100644 --- a/src/gui/curses/gui-curses-window.c +++ b/src/gui/curses/gui-curses-window.c @@ -34,6 +34,7 @@ #include "../../core/wee-hook.h" #include "../../core/wee-log.h" #include "../../core/wee-string.h" +#include "../../core/wee-utf8.h" #include "../../plugins/plugin.h" #include "../gui-window.h" #include "../gui-bar.h" @@ -159,6 +160,26 @@ gui_window_utf_char_valid (const char *utf_char) return 1; } +/* + * gui_window_get_hline_char: get char used to draw horizontal lines + * Note: ACS_HLINE from ncurses is better for + * render, but it introduces bug with URLs + * selected by terminal: below this line, + * some URLs are not visible or shifted + */ + +int +gui_window_get_hline_char () +{ + const char *hline_char; + + hline_char = CONFIG_STRING(config_look_hline_char); + if (!hline_char || !hline_char[0]) + return ACS_HLINE; + + return utf8_char_int (hline_char); +} + /* * gui_window_wprintw: decode then display string with wprintw */ diff --git a/src/gui/curses/gui-curses.h b/src/gui/curses/gui-curses.h index 70f89b5cc..30ac8f71d 100644 --- a/src/gui/curses/gui-curses.h +++ b/src/gui/curses/gui-curses.h @@ -77,6 +77,7 @@ extern int gui_keyboard_read_cb (void *data, int fd); extern void gui_window_read_terminal_size (); extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer); extern int gui_window_utf_char_valid (const char *utf_char); +extern int gui_window_get_hline_char (); extern void gui_window_clear (WINDOW *window, int bg); extern void gui_window_reset_style (WINDOW *window, int num_color); extern void gui_window_set_color_style (WINDOW *window, int style);