When deleting words, delete preceding whitespace as well. (#325358, Akkana

2006-01-02  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkentry.c (gtk_entry_delete_from_cursor): When deleting
	words, delete preceding whitespace as well.  (#325358, Akkana Peck)
This commit is contained in:
Matthias Clasen
2006-01-03 03:58:19 +00:00
committed by Matthias Clasen
parent dad73781b7
commit 5a3c267b79
3 changed files with 16 additions and 6 deletions

View File

@@ -1,3 +1,8 @@
2006-01-02 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_delete_from_cursor): When deleting
words, delete preceding whitespace as well. (#325358, Akkana Peck)
2006-01-02 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c

View File

@@ -1,3 +1,8 @@
2006-01-02 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_delete_from_cursor): When deleting
words, delete preceding whitespace as well. (#325358, Akkana Peck)
2006-01-02 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c

View File

@@ -2528,26 +2528,26 @@ gtk_entry_delete_from_cursor (GtkEntry *entry,
if (count < 0)
{
/* Move to end of current word, or if not on a word, end of previous word */
end_pos = gtk_entry_move_backward_word (entry, end_pos, TRUE);
end_pos = gtk_entry_move_forward_word (entry, end_pos, TRUE);
end_pos = gtk_entry_move_backward_word (entry, end_pos, FALSE);
end_pos = gtk_entry_move_forward_word (entry, end_pos, FALSE);
}
else if (count > 0)
{
/* Move to beginning of current word, or if not on a word, begining of next word */
start_pos = gtk_entry_move_forward_word (entry, start_pos, TRUE);
start_pos = gtk_entry_move_backward_word (entry, start_pos, TRUE);
start_pos = gtk_entry_move_forward_word (entry, start_pos, FALSE);
start_pos = gtk_entry_move_backward_word (entry, start_pos, FALSE);
}
/* Fall through */
case GTK_DELETE_WORD_ENDS:
while (count < 0)
{
start_pos = gtk_entry_move_backward_word (entry, start_pos, TRUE);
start_pos = gtk_entry_move_backward_word (entry, start_pos, FALSE);
count++;
}
while (count > 0)
{
end_pos = gtk_entry_move_forward_word (entry, end_pos, TRUE);
end_pos = gtk_entry_move_forward_word (entry, end_pos, FALSE);
count--;
}
gtk_editable_delete_text (editable, start_pos, end_pos);