1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-26 05:02:18 +00:00

fix that history backward/forward functions invalid the multi-bytes

cursor movement.

PR:		ports/35560
Submitted by:	Chou Yeh-Jyi <yjchou@cis.nctu.edu.tw>
This commit is contained in:
Vanilla I. Shu 2002-03-08 16:49:29 +00:00
parent 64baa5ac91
commit 55112eb138
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=55730
3 changed files with 64 additions and 6 deletions

View File

@ -8,11 +8,12 @@
MASTERDIR= ${.CURDIR}/../../irc/irssi
EXTRA_PATCHES= ${.CURDIR}/files/patch-irssi.conf \
${.CURDIR}/files/patch-src::fe-text::gui-entry.c \
${.CURDIR}/files/patch-src::fe-text::gui-entry.h \
${.CURDIR}/files/patch-src::fe-text::term-terminfo.c \
${.CURDIR}/files/patch-src::fe-text::textbuffer-view.c \
${.CURDIR}/files/patch-src::fe-text::utf8.h
PORTREVISION= 0
PORTREVISION= 1
CATEGORIES= chinese
MAINTAINER= vanilla@FreeBSD.org

View File

@ -1,6 +1,16 @@
--- src/fe-text/gui-entry.c.orig Sat Feb 16 19:10:11 2002
+++ src/fe-text/gui-entry.c Sun Mar 3 10:29:10 2002
@@ -67,6 +69,27 @@
+++ src/fe-text/gui-entry.c Sat Mar 9 00:38:18 2002
@@ -37,7 +37,8 @@
return;
entry->text_alloc = nearest_power(entry->text_alloc+grow_size);
- entry->text = g_realloc(entry->text, entry->text_alloc);
+ entry->text = g_realloc(entry->text,
+ sizeof(unichar) * entry->text_alloc);
}
GUI_ENTRY_REC *gui_entry_create(int xpos, int ypos, int width, int utf8)
@@ -67,6 +68,27 @@
g_free(entry);
}
@ -28,7 +38,7 @@
/* Fixes the cursor position in screen */
static void gui_entry_fix_cursor(GUI_ENTRY_REC *entry)
{
@@ -84,6 +107,8 @@
@@ -84,6 +106,8 @@
entry->scrstart = entry->pos - entry->scrpos;
}
@ -37,7 +47,34 @@
if (old_scrstart != entry->scrstart)
entry->redraw_needed_from = 0;
}
@@ -335,11 +360,18 @@
@@ -195,7 +219,7 @@
}
}
-void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const char *str)
+void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const unsigned char *str)
{
int oldlen;
@@ -231,7 +255,7 @@
entry->utf8 = utf8;
}
-void gui_entry_set_text(GUI_ENTRY_REC *entry, const char *str)
+void gui_entry_set_text(GUI_ENTRY_REC *entry, const unsigned char *str)
{
g_return_if_fail(entry != NULL);
g_return_if_fail(str != NULL);
@@ -260,7 +284,7 @@
return buf;
}
-void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str)
+void gui_entry_insert_text(GUI_ENTRY_REC *entry, const unsigned char *str)
{
unichar chr;
int i, len;
@@ -335,11 +359,18 @@
void gui_entry_erase(GUI_ENTRY_REC *entry, int size)
{
@ -56,7 +93,7 @@
/* put erased text to cutbuffer */
if (entry->cutbuffer == NULL || entry->cutbuffer_len < size) {
g_free(entry->cutbuffer);
@@ -461,10 +493,24 @@
@@ -461,10 +492,24 @@
void gui_entry_move_pos(GUI_ENTRY_REC *entry, int pos)
{

View File

@ -0,0 +1,20 @@
--- src/fe-text/gui-entry.h.orig Sat Mar 9 00:22:21 2002
+++ src/fe-text/gui-entry.h Sat Mar 9 00:22:48 2002
@@ -28,14 +28,14 @@
void gui_entry_move(GUI_ENTRY_REC *entry, int xpos, int ypos, int width);
void gui_entry_set_active(GUI_ENTRY_REC *entry);
-void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const char *str);
+void gui_entry_set_prompt(GUI_ENTRY_REC *entry, const unsigned char *str);
void gui_entry_set_hidden(GUI_ENTRY_REC *entry, int hidden);
void gui_entry_set_utf8(GUI_ENTRY_REC *entry, int utf8);
-void gui_entry_set_text(GUI_ENTRY_REC *entry, const char *str);
+void gui_entry_set_text(GUI_ENTRY_REC *entry, const unsigned char *str);
char *gui_entry_get_text(GUI_ENTRY_REC *entry);
-void gui_entry_insert_text(GUI_ENTRY_REC *entry, const char *str);
+void gui_entry_insert_text(GUI_ENTRY_REC *entry, const unsigned char *str);
void gui_entry_insert_char(GUI_ENTRY_REC *entry, unichar chr);
char *gui_entry_get_cutbuffer(GUI_ENTRY_REC *entry);