diff options
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; |