From 1dcd5a6eaa8d7f84e3bf3eade4454da1e82dbcf8 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Wed, 24 Jun 2009 13:58:40 +0200 Subject: [PATCH] Implement GTK_DELETE_WORD_ENDS and GTK_DELETE_WORDS --- app/tools/gimptexttool.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/tools/gimptexttool.c b/app/tools/gimptexttool.c index 4d4404dea8..b268f807a3 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: