summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyuunosuke Ayanokouzi <i38w7i3@yahoo.co.jp>2012-03-03 10:03:13 +0100
committerSebastien Helleu <flashcode@flashtux.org>2012-03-03 10:03:13 +0100
commit5f11df74e3428f952c466f630547d21cc702bf1c (patch)
treeacfdbf2e28a4e27f2fc04f1b4fbc9d58e89d02cb
parent313c3734925c4ed55c05250acbe5ecad1ee05c6f (diff)
downloadweechat-5f11df74e3428f952c466f630547d21cc702bf1c.zip
core: fix display of wide chars on last column of chat area (patch #7733)
-rw-r--r--ChangeLog3
-rw-r--r--src/gui/gui-chat.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 1cbec904f..d8d263f75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/src/gui/gui-chat.c b/src/gui/gui-chat.c
index f337fc0e2..64272a957 100644
--- a/src/gui/gui-chat.c
+++ b/src/gui/gui-chat.c
@@ -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);
}