summaryrefslogtreecommitdiff
path: root/src/fe-text/gui-entry.c
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2007-05-25 22:21:39 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2007-05-25 22:21:39 +0000
commit8a9da9cf2de8189fd68be746ba55fa85b8f2b424 (patch)
tree42622f7706ac8691795682f425f161ae151d805a /src/fe-text/gui-entry.c
parentceea629e3ea0a3c8f7befe55e7afa47daa07fdd7 (diff)
downloadirssi-8a9da9cf2de8189fd68be746ba55fa85b8f2b424.zip
Add function to delete the whole cell under the cursor and use it for
delete_character. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4521 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/gui-entry.c')
-rw-r--r--src/fe-text/gui-entry.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c
index c045de83..d9744cd0 100644
--- a/src/fe-text/gui-entry.c
+++ b/src/fe-text/gui-entry.c
@@ -561,6 +561,25 @@ void gui_entry_erase(GUI_ENTRY_REC *entry, int size, int update_cutbuffer)
gui_entry_draw(entry);
}
+void gui_entry_erase_cell(GUI_ENTRY_REC *entry)
+{
+ int size = 1;
+
+ g_return_if_fail(entry != NULL);
+
+ if (entry->utf8)
+ while (entry->pos+size < entry->text_len &&
+ mk_wcwidth(entry->text[entry->pos+size]) == 0) size++;
+
+ g_memmove(entry->text + entry->pos, entry->text + entry->pos + size,
+ (entry->text_len-entry->pos-size+1) * sizeof(unichar));
+
+ entry->text_len -= size;
+
+ gui_entry_redraw_from(entry, entry->pos);
+ gui_entry_draw(entry);
+}
+
void gui_entry_erase_word(GUI_ENTRY_REC *entry, int to_space)
{
int to;