From a8c540ea597fb17426c5458fa464f9c505c3bda8 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 23 May 2020 22:00:00 +0100 Subject: move content specific selection end to content handlers --- content/handlers/text/textplain.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'content/handlers/text/textplain.c') diff --git a/content/handlers/text/textplain.c b/content/handlers/text/textplain.c index 5142291bb..1165bcf5d 100644 --- a/content/handlers/text/textplain.c +++ b/content/handlers/text/textplain.c @@ -1228,7 +1228,7 @@ textplain_open(struct content *c, text->bw = bw; /* text selection */ - selection_init(&text->sel, NULL); + selection_init(&text->sel); return NSERROR_OK; } @@ -1580,7 +1580,7 @@ textplain_create_selection(struct content *c, struct selection **sel_out) return NSERROR_NOMEM; } - selection_init(sel, NULL); + selection_init(sel); *sel_out = sel; return NSERROR_OK; @@ -1626,6 +1626,13 @@ textplain_textselection_copy(struct content *c, return NSERROR_OK; } +static nserror +textplain_textselection_get_end(struct content *c, unsigned *end_idx) +{ + *end_idx = textplain_size(c); + return NSERROR_OK; +} + /** * plain text content handler table */ @@ -1649,6 +1656,7 @@ static const content_handler textplain_content_handler = { .textsearch_bounds = textplain_textsearch_bounds, .textselection_redraw = textplain_textselection_redraw, .textselection_copy = textplain_textselection_copy, + .textselection_get_end = textplain_textselection_get_end, .create_selection = textplain_create_selection, .no_share = true, }; -- cgit v1.2.3