diff options
author | Timo Sirainen <cras@irssi.org> | 2001-03-03 18:04:10 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-03-03 18:04:10 +0000 |
commit | 88094fa9f28476241c1fb39ca937defe37b60e4f (patch) | |
tree | a4ee58b11b74b7053ada997ae4ea02d4cffba13a /src/fe-text | |
parent | 95c17bafc46714702092dacdab7d58bb005a158d (diff) | |
download | irssi-88094fa9f28476241c1fb39ca937defe37b60e4f.zip |
delete_next_word key implemented, patch by Tinuk
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1311 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/gui-entry.c | 18 | ||||
-rw-r--r-- | src/fe-text/gui-entry.h | 1 | ||||
-rw-r--r-- | src/fe-text/gui-readline.c | 4 |
3 files changed, 21 insertions, 2 deletions
diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index 4fb67596..f60525b9 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -183,6 +183,24 @@ void gui_entry_erase_word(void) 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) { return pos; diff --git a/src/fe-text/gui-entry.h b/src/fe-text/gui-entry.h index 2e31ad69..ff8f3ef5 100644 --- a/src/fe-text/gui-entry.h +++ b/src/fe-text/gui-entry.h @@ -16,6 +16,7 @@ void gui_entry_insert_char(char chr); void gui_entry_erase(int size); void gui_entry_erase_word(void); +void gui_entry_erase_next_word(void); int gui_entry_get_pos(void); void gui_entry_set_pos(int pos); diff --git a/src/fe-text/gui-readline.c b/src/fe-text/gui-readline.c index 8d9d3321..7d48c557 100644 --- a/src/fe-text/gui-readline.c +++ b/src/fe-text/gui-readline.c @@ -385,12 +385,12 @@ static void key_backspace(void) static void key_delete_previous_word(void) { - /* FIXME */ + gui_entry_erase_word(); } static void key_delete_next_word(void) { - /* FIXME */ + gui_entry_erase_next_word(); } static void key_delete_to_previous_space(void) |