mirror of
https://github.com/weechat/weechat.git
synced 2026-07-05 01:03:14 +02:00
core: fix display of wide chars on last column of chat area (patch #7733)
This commit is contained in:
committed by
Sebastien Helleu
parent
313c373492
commit
5f11df74e3
@@ -1,12 +1,13 @@
|
||||
WeeChat ChangeLog
|
||||
=================
|
||||
Sébastien Helleu <flashcode@flashtux.org>
|
||||
v0.3.8-dev, 2012-02-29
|
||||
v0.3.8-dev, 2012-03-03
|
||||
|
||||
|
||||
Version 0.3.8 (under dev!)
|
||||
--------------------------
|
||||
|
||||
* core: fix display of wide chars on last column of chat area (patch #7733)
|
||||
* irc: add support of "external" SASL mechanism (task #11864)
|
||||
* irc: close server buffer when server is deleted
|
||||
* irc: add search for lower case nicks in option irc.look.nick_color_force
|
||||
|
||||
+5
-1
@@ -233,13 +233,14 @@ gui_chat_string_add_offset_screen (const char *string, int offset_screen)
|
||||
int
|
||||
gui_chat_string_real_pos (const char *string, int pos)
|
||||
{
|
||||
const char *real_pos, *ptr_string;
|
||||
const char *real_pos, *real_pos_prev, *ptr_string;
|
||||
int size_on_screen;
|
||||
|
||||
if (pos <= 0)
|
||||
return 0;
|
||||
|
||||
real_pos = string;
|
||||
real_pos_prev = string;
|
||||
ptr_string = string;
|
||||
while (ptr_string && ptr_string[0] && (pos > 0))
|
||||
{
|
||||
@@ -252,9 +253,12 @@ gui_chat_string_real_pos (const char *string, int pos)
|
||||
if (size_on_screen > 0)
|
||||
pos -= size_on_screen;
|
||||
ptr_string = utf8_next_char (ptr_string);
|
||||
real_pos_prev = real_pos;
|
||||
real_pos = ptr_string;
|
||||
}
|
||||
}
|
||||
if (pos < 0)
|
||||
real_pos = real_pos_prev;
|
||||
return 0 + (real_pos - string);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user