1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

delete_next_word key implemented, patch by Tinuk

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1311 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-03-03 18:04:10 +00:00 committed by cras
parent 95c17bafc4
commit 88094fa9f2
3 changed files with 21 additions and 2 deletions

View File

@ -183,6 +183,24 @@ void gui_entry_erase_word(void)
entry_update(); entry_update();
} }
void gui_entry_erase_next_word(void)
{
int to = pos;
if (pos == entry->len) return;
while (entry->str[to] == ' ' && to < entry->len)
to++;
while (entry->str[to] != ' ' && to < entry->len)
to++;
g_string_erase(entry, pos, to - pos);
entry_screenpos();
entry_update();
}
int gui_entry_get_pos(void) int gui_entry_get_pos(void)
{ {
return pos; return pos;

View File

@ -16,6 +16,7 @@ void gui_entry_insert_char(char chr);
void gui_entry_erase(int size); void gui_entry_erase(int size);
void gui_entry_erase_word(void); void gui_entry_erase_word(void);
void gui_entry_erase_next_word(void);
int gui_entry_get_pos(void); int gui_entry_get_pos(void);
void gui_entry_set_pos(int pos); void gui_entry_set_pos(int pos);

View File

@ -385,12 +385,12 @@ static void key_backspace(void)
static void key_delete_previous_word(void) static void key_delete_previous_word(void)
{ {
/* FIXME */ gui_entry_erase_word();
} }
static void key_delete_next_word(void) static void key_delete_next_word(void)
{ {
/* FIXME */ gui_entry_erase_next_word();
} }
static void key_delete_to_previous_space(void) static void key_delete_to_previous_space(void)