diff options
author | Timo Sirainen <cras@irssi.org> | 2000-07-09 11:39:21 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-07-09 11:39:21 +0000 |
commit | 0fcb26a9553c70d48b7d469cb616da034acafde6 (patch) | |
tree | 08eb0978dc7db73fde308b4deb813661b870ce9a /src/fe-text | |
parent | 8bea491a572a4038ea23d38fb6b9691bbd3a44a3 (diff) | |
download | irssi-0fcb26a9553c70d48b7d469cb616da034acafde6.zip |
Ctrl-Y undeletes the last ^U'd line.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@438 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/gui-readline.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index e751fb6b..2a5838b1 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -46,6 +46,7 @@ typedef struct { static ENTRY_REDIRECT_REC *redir; +static char *savebuffer; static int readtag, sigint_count = 0; static time_t idle_time; @@ -195,9 +196,15 @@ void handle_key(int key) case 21: /* Ctrl-U, clear line */ + g_free_not_null(savebuffer); + savebuffer = g_strdup(gui_entry_get_text()); + gui_entry_set_text(""); break; - + case 25: + /* Ctrl-Y, write last ^U'd line */ + gui_entry_insert_text(savebuffer); + break; case 9: key_pressed("Tab", NULL); break; @@ -423,6 +430,7 @@ void gui_readline_init(void) char *key, data[MAX_INT_STRLEN]; int n; + savebuffer = NULL; redir = NULL; idle_time = time(NULL); readtag = g_input_add(0, G_INPUT_READ, (GInputFunction) readline, NULL); @@ -464,6 +472,7 @@ void gui_readline_init(void) void gui_readline_deinit(void) { + g_free_not_null(savebuffer); g_source_remove(readtag); key_unbind("completion", (SIGNAL_FUNC) sig_completion); |