mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
Merge branch 'textview-ctrl-backspace' into 'main'
textview: Improve word navigation Closes #737 See merge request GNOME/gtk!6080
This commit is contained in:
commit
5e07710f5a
@ -6477,7 +6477,10 @@ gtk_text_view_move_cursor (GtkTextView *text_view,
|
||||
count *= -1;
|
||||
|
||||
if (count < 0)
|
||||
gtk_text_iter_backward_visible_word_starts (&newplace, -count);
|
||||
{
|
||||
if (!gtk_text_iter_backward_visible_word_starts (&newplace, -count))
|
||||
gtk_text_iter_set_line_offset (&newplace, 0);
|
||||
}
|
||||
else if (count > 0)
|
||||
{
|
||||
if (!gtk_text_iter_forward_visible_word_ends (&newplace, count))
|
||||
@ -6909,7 +6912,10 @@ gtk_text_view_delete_from_cursor (GtkTextView *text_view,
|
||||
if (count > 0)
|
||||
gtk_text_iter_forward_word_ends (&end, count);
|
||||
else if (count < 0)
|
||||
gtk_text_iter_backward_word_starts (&start, 0 - count);
|
||||
{
|
||||
if (!gtk_text_iter_backward_word_starts (&start, 0 - count))
|
||||
gtk_text_iter_set_line_offset (&start, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
case GTK_DELETE_WORDS:
|
||||
|
Loading…
Reference in New Issue
Block a user