diff options
author | Timo Sirainen <cras@irssi.org> | 2000-06-14 18:02:13 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-06-14 18:02:13 +0000 |
commit | 72b32ff1755c9223294d6069fa00eaa039563e64 (patch) | |
tree | 12084ba7040d976adda46380730b2ab397a357ee /src/fe-text/gui-entry.c | |
parent | 22b12d85ee7112e404d4b6af1ac52878baef50e7 (diff) | |
download | irssi-72b32ff1755c9223294d6069fa00eaa039563e64.zip |
Ctrl-W deletes word in left - patch from
Kjetil �degaard <kjetilod@orakel.ntnu.no>
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@341 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/gui-entry.c')
-rw-r--r-- | src/fe-text/gui-entry.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index 62ea83fb..7bc8868d 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -149,6 +149,30 @@ void gui_entry_erase(int size) entry_update(); } +void gui_entry_erase_word(void) +{ + int to; + + if (pos == 0) return; + + to = pos - 1; + + while (entry->str[to] == ' ' && to > 0) + to--; + + while (entry->str[to] != ' ' && to > 0) + to--; + + if (entry->str[to] == ' ' && to > 0) + to++; + + g_string_erase(entry, to, pos - to); + pos = to; + + entry_screenpos(); + entry_update(); +} + int gui_entry_get_pos(void) { return pos; |