[gimp] Implement GTK_DELETE_WORD_ENDS and GTK_DELETE_WORDS
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Subject: [gimp] Implement GTK_DELETE_WORD_ENDS and GTK_DELETE_WORDS
- Date: Wed, 24 Jun 2009 11:59:07 +0000 (UTC)
commit 1dcd5a6eaa8d7f84e3bf3eade4454da1e82dbcf8
Author: Michael Natterer <mitch gimp org>
Date: Wed Jun 24 13:58:40 2009 +0200
Implement GTK_DELETE_WORD_ENDS and GTK_DELETE_WORDS
app/tools/gimptexttool.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c
index 4d4404d..b268f80 100644
--- a/app/tools/gimptexttool.c
+++ b/app/tools/gimptexttool.c
@@ -1657,9 +1657,26 @@ gimp_text_tool_delete_from_cursor (GimpTextTool *text_tool,
break;
case GTK_DELETE_WORD_ENDS:
+ if (count < 0)
+ {
+ if (! gtk_text_iter_starts_word (&cursor))
+ gtk_text_iter_backward_visible_word_starts (&cursor, 1);
+ }
+ else if (count > 0)
+ {
+ if (! gtk_text_iter_ends_word (&end) &&
+ ! gtk_text_iter_forward_visible_word_ends (&end, 1))
+ gtk_text_iter_forward_to_line_end (&end);
+ }
break;
case GTK_DELETE_WORDS:
+ if (! gtk_text_iter_starts_word (&cursor))
+ gtk_text_iter_backward_visible_word_starts (&cursor, 1);
+
+ if (! gtk_text_iter_ends_word (&end) &&
+ ! gtk_text_iter_forward_visible_word_ends (&end, 1))
+ gtk_text_iter_forward_to_line_end (&end);
break;
case GTK_DELETE_DISPLAY_LINES:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]