1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-22 20:41:26 +00:00

Add a patch to fix readline routine problem.

PR:		ports/50374
Submitted by:	Michael Hsin <mhsin@mhsin.org>
This commit is contained in:
Vanilla I. Shu 2003-04-01 02:03:43 +00:00
parent ada2c72a12
commit 17994e305b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=77882
2 changed files with 38 additions and 9 deletions

View File

@ -13,7 +13,7 @@ EXTRA_PATCHES= ${.CURDIR}/files/patch-irssi.conf \
${.CURDIR}/files/patch-src::fe-text::textbuffer-view.c \
${.CURDIR}/files/patch-src::fe-text::utf8.h
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= chinese
MAINTAINER= vanilla@FreeBSD.org

View File

@ -1,11 +1,40 @@
--- src/fe-text/gui-readline.c.orig Mon Nov 11 15:00:02 2002
+++ src/fe-text/gui-readline.c Sun Dec 29 19:17:27 2002
@@ -302,7 +302,7 @@
+++ src/fe-text/gui-readline.c Tue Apr 1 09:47:02 2003
@@ -50,6 +50,10 @@
static ENTRY_REDIRECT_REC *redir;
static int escape_next_key;
pos = gui_entry_get_pos(active_entry);
gui_entry_set_pos(active_entry, active_entry->text_len);
- gui_entry_erase(active_entry, active_entry->text_len - pos, TRUE);
+ gui_entry_erase_to(active_entry, pos, TRUE);
}
+static int big5high = FALSE;
+static unichar prekey = '\0';
+
+
static int readtag;
static time_t idle_time;
static void key_yank_from_cutbuffer(void)
@@ -148,7 +152,25 @@
idle_time = time(NULL);
- if (key < 32) {
+ if(big5high || is_big5_hi(key))
+ {
+ if(big5high)
+ {
+ big5high = FALSE;
+ str[0] = prekey;
+ str[1] = key;
+ str[2] = '\0';
+ gui_entry_insert_text(active_entry, str);
+ return;
+ }
+ else
+ {
+ big5high = TRUE;
+ prekey = key;
+ return;
+ }
+ }
+ else if (key < 32) {
/* control key */
str[0] = '^';
str[1] = (char)key+'@';