1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

Fix bug with URL selection in some terminals (caused by horizontal lines) (bug #27700)

This commit is contained in:
Sebastien Helleu
2009-10-14 18:21:46 +02:00
parent 37835df573
commit a08842bbad
17 changed files with 108 additions and 17 deletions
+2
View File
@@ -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)
+5
View File
@@ -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
+5
View File
@@ -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
+6 -1
View File
@@ -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 <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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 ""
+6 -1
View File
@@ -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 <i18n@internet-villa.de>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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 ""
+6 -1
View File
@@ -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 <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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 ""
+10 -2
View File
@@ -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 <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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 ""
+6 -1
View File
@@ -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 <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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 ""
+6 -1
View File
@@ -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 <soltys@szluug.org>\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 ""
+6 -1
View File
@@ -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 <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\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 ""
+6 -1
View File
@@ -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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\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 ""
+8
View File
@@ -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",
+1
View File
@@ -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;
+8 -4
View File
@@ -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,
+5 -4
View File
@@ -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:
+21
View File
@@ -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
*/
+1
View File
@@ -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);