summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7391a6e)
raw | patch | inline | side by side (parent: 7391a6e)
author | Kalle Wallin <kaw@linux.se> | |
Tue, 28 Mar 2006 07:43:51 +0000 (07:43 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Tue, 28 Mar 2006 07:43:51 +0000 (07:43 +0000) |
ChangeLog | patch | blob | history | |
src/wreadln.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index bc21a2d0307ce7a66ed22667486f89fdc7bc96cd..62a9af590cf22b363f1c7886216cfd17e5bb7381 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-03-28 Kalle Wallin <kaw@linux.se>
+ * wreadln.c: fixed TAB completion support when built with libcursesw
+ (path from René van Bevern)
+
2006-01-22 Kalle Wallin <kaw@linux.se>
* configure.ac: use libcursesw by default
* wreadln.c: use wget_wch (wide characters) when built with libcursesw
diff --git a/src/wreadln.c b/src/wreadln.c
index d5c25cc8b5b144bc24dd9e0fff6fea19941cf5f5..fac2080c2ae2c935cca54538b1e25eaad920a846 100644 (file)
--- a/src/wreadln.c
+++ b/src/wreadln.c
case KEY_CTRL_E:
cursor_move_to_eol();
break;
+ case TAB:
+ if( gcmp )
+ {
+ char *prefix = NULL;
+ GList *list;
+
+ i = wcstombs(NULL,wline,0)+1;
+ mbline = g_malloc0(i);
+ wcstombs(mbline, wline, i);
+
+ if(wrln_pre_completion_callback)
+ wrln_pre_completion_callback(gcmp, mbline);
+ list = g_completion_complete(gcmp, mbline, &prefix);
+ if( prefix )
+ {
+ mbstowcs(wline, prefix, wrln_max_line_size);
+ cursor_move_to_eol();
+ g_free(prefix);
+ }
+ else
+ screen_bell();
+ if( wrln_post_completion_callback )
+ wrln_post_completion_callback(gcmp, mbline, list);
+
+ g_free(mbline);
+ }
+ break;
case KEY_CTRL_G:
screen_bell();
g_free(wline);