Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions xed/xed-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,34 @@ xed_view_delete_from_cursor (GtkTextView *text_view,
}
}

static gboolean
xed_view_extend_selection (GtkTextView *text_view,
GtkTextExtendSelection granularity,
const GtkTextIter *location,
GtkTextIter *start,
GtkTextIter *end)
{
/* Override the triple-click so the entire line, not just the displayed
* line is selected.
*/
if (granularity == GTK_TEXT_EXTEND_SELECTION_LINE)
{
*start = *location;
*end = *location;

gtk_text_iter_set_line_offset (start, 0);

if (!gtk_text_iter_ends_line (end))
{
gtk_text_iter_forward_to_line_end (end);
}

return GDK_EVENT_STOP;
}

return GTK_TEXT_VIEW_CLASS (xed_view_parent_class)->extend_selection (text_view, granularity, location, start, end);
}

static GtkTextBuffer *
xed_view_create_buffer (GtkTextView *text_view)
{
Expand Down Expand Up @@ -589,6 +617,7 @@ xed_view_class_init (XedViewClass *klass)

text_view_class->delete_from_cursor = xed_view_delete_from_cursor;
text_view_class->create_buffer = xed_view_create_buffer;
text_view_class->extend_selection = xed_view_extend_selection;

/* A new signal DROP_URIS has been added to allow plugins to intercept
* the default dnd behaviour of 'text/uri-list'. XedView now handles
Expand Down