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
This commit is contained in:
Timo Sirainen 2000-06-14 18:02:13 +00:00 committed by cras
commit 72b32ff175
3 changed files with 31 additions and 0 deletions

View file

@ -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;