summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2007-05-25 23:21:38 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-05-25 23:21:38 +0000
commit4f98e29bab6e61cbbfd0fd28ab530629c454d3f8 (patch)
tree8592d8817b773d97fb0035252a8bb6f155298b8f /src
parent8a9da9cf2de8189fd68be746ba55fa85b8f2b424 (diff)
downloadirssi-4f98e29bab6e61cbbfd0fd28ab530629c454d3f8.zip
Make word commands unicode friendly.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4522 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-text/gui-entry.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c
index d9744cd0..546c79ba 100644
--- a/src/fe-text/gui-entry.c
+++ b/src/fe-text/gui-entry.c
@@ -27,6 +27,31 @@
#include "gui-printtext.h"
#include "term.h"
+#undef i_toupper
+#undef i_tolower
+#undef i_isalnum
+
+static unichar i_toupper(unichar c)
+{
+ if (term_type == TERM_TYPE_UTF8)
+ return g_unichar_toupper(c);
+ return (c >= 0 && c <= 255) ? toupper(c) : c;
+}
+
+static unichar i_tolower(unichar c)
+{
+ if (term_type == TERM_TYPE_UTF8)
+ return g_unichar_tolower(c);
+ return (c >= 0 && c <= 255) ? tolower(c) : c;
+}
+
+static int i_isalnum(unichar c)
+{
+ if (term_type == TERM_TYPE_UTF8)
+ return (g_unichar_isalnum(c) || mk_wcwidth(c) == 0);
+ return (c >= 0 && c <= 255) ? isalnum(c) : 0;
+}
+
const unichar empty_str[] = { 0 };
GUI_ENTRY_REC *active_entry;