Compare commits

...

1 Commits

Author SHA1 Message Date
Robert Roth
83ca718072 textview: select newline on triple-click select (#253)
When triple-clicking a line, also select the newline character to
avoid causing formatting issues on pasting the selected line.

Technically this is done by jumping to the start of the next display
line, instead of the previous behaviour, jumping to the end of the current
display line.

https://gitlab.gnome.org/GNOME/gtk/issues/253
2018-08-24 11:34:47 +03:00

View File

@@ -6946,12 +6946,15 @@ gtk_text_view_extend_selection (GtkTextView *text_view,
else
{
/* start isn't on the start of a line, so we move it to the
* start, and move end to the end unless it's already there.
* start, and move start to the start of the next line unless
* it's already there.
*/
gtk_text_view_backward_display_line_start (text_view, start);
if (!gtk_text_view_starts_display_line (text_view, end))
gtk_text_view_forward_display_line_end (text_view, end);
if (!gtk_text_view_starts_display_line (text_view, end)) {
gtk_text_view_forward_display_line (text_view, end);
gtk_text_view_backward_display_line_start (text_view, end);
}
}
break;