1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 19:23:13 +02:00

core: fix text emphasis with wide chars on screen like japanese (patch #8253) (patch from Ryuunosuke Ayanokouzi)

This commit is contained in:
Sebastien Helleu
2013-12-11 12:48:32 +01:00
parent 92ab912fae
commit 95adb3a04b
6 changed files with 23 additions and 10 deletions
+3 -1
View File
@@ -582,7 +582,9 @@ gui_bar_window_draw (struct t_gui_bar_window *bar_window,
}
/* compute new start for displaying input */
new_start_input = pos_after_start_input + gui_chat_string_real_pos (pos_after_start_input, diff);
new_start_input = pos_after_start_input +
gui_chat_string_real_pos (pos_after_start_input,
diff, 1);
if (new_start_input > pos_cursor)
new_start_input = pos_cursor;
+6 -4
View File
@@ -527,7 +527,8 @@ gui_chat_display_word (struct t_gui_window *window,
if (window->win_chat_cursor_x + chars_to_display > gui_chat_get_real_width (window))
{
num_displayed = gui_chat_get_real_width (window) - window->win_chat_cursor_x;
pos_saved_char = gui_chat_string_real_pos (ptr_data, num_displayed);
pos_saved_char = gui_chat_string_real_pos (ptr_data, num_displayed,
1);
saved_char = ptr_data[pos_saved_char];
ptr_data[pos_saved_char] = '\0';
if ((count == 0) || (*lines_displayed >= num_lines - count))
@@ -790,7 +791,8 @@ gui_chat_display_time_to_prefix (struct t_gui_window *window,
short_name,
short_name +
gui_chat_string_real_pos (short_name,
chars_to_display),
chars_to_display,
1),
1, num_lines, count,
pre_lines_displayed, lines_displayed,
simulate,
@@ -1043,9 +1045,9 @@ gui_chat_display_time_to_prefix (struct t_gui_window *window,
(prefix_highlighted) ? prefix_highlighted : ptr_prefix,
(prefix_highlighted) ?
prefix_highlighted + gui_chat_string_real_pos (prefix_highlighted,
chars_to_display) :
chars_to_display, 1) :
ptr_prefix + gui_chat_string_real_pos (ptr_prefix,
chars_to_display),
chars_to_display, 1),
1, num_lines, count,
pre_lines_displayed,
lines_displayed,