mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Ctrl-Y undeletes the last ^U'd line.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@438 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
8bea491a57
commit
0fcb26a955
@ -46,6 +46,7 @@ typedef struct {
|
|||||||
|
|
||||||
static ENTRY_REDIRECT_REC *redir;
|
static ENTRY_REDIRECT_REC *redir;
|
||||||
|
|
||||||
|
static char *savebuffer;
|
||||||
static int readtag, sigint_count = 0;
|
static int readtag, sigint_count = 0;
|
||||||
static time_t idle_time;
|
static time_t idle_time;
|
||||||
|
|
||||||
@ -195,9 +196,15 @@ void handle_key(int key)
|
|||||||
|
|
||||||
case 21:
|
case 21:
|
||||||
/* Ctrl-U, clear line */
|
/* Ctrl-U, clear line */
|
||||||
|
g_free_not_null(savebuffer);
|
||||||
|
savebuffer = g_strdup(gui_entry_get_text());
|
||||||
|
|
||||||
gui_entry_set_text("");
|
gui_entry_set_text("");
|
||||||
break;
|
break;
|
||||||
|
case 25:
|
||||||
|
/* Ctrl-Y, write last ^U'd line */
|
||||||
|
gui_entry_insert_text(savebuffer);
|
||||||
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
key_pressed("Tab", NULL);
|
key_pressed("Tab", NULL);
|
||||||
break;
|
break;
|
||||||
@ -423,6 +430,7 @@ void gui_readline_init(void)
|
|||||||
char *key, data[MAX_INT_STRLEN];
|
char *key, data[MAX_INT_STRLEN];
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
savebuffer = NULL;
|
||||||
redir = NULL;
|
redir = NULL;
|
||||||
idle_time = time(NULL);
|
idle_time = time(NULL);
|
||||||
readtag = g_input_add(0, G_INPUT_READ, (GInputFunction) readline, 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)
|
void gui_readline_deinit(void)
|
||||||
{
|
{
|
||||||
|
g_free_not_null(savebuffer);
|
||||||
g_source_remove(readtag);
|
g_source_remove(readtag);
|
||||||
|
|
||||||
key_unbind("completion", (SIGNAL_FUNC) sig_completion);
|
key_unbind("completion", (SIGNAL_FUNC) sig_completion);
|
||||||
|
Loading…
Reference in New Issue
Block a user