summaryrefslogtreecommitdiff
path: root/content/handlers/text/textplain.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2020-05-23 22:00:00 +0100
committerVincent Sanders <vince@kyllikki.org>2020-05-23 23:00:08 +0100
commita8c540ea597fb17426c5458fa464f9c505c3bda8 (patch)
treeff85eff8288d5c1584d82ef6719b3c87ce7e5f48 /content/handlers/text/textplain.c
parentcfe57002febe0f58dfc87f0173ad42126f1362f4 (diff)
downloadnetsurf-a8c540ea597fb17426c5458fa464f9c505c3bda8.tar.gz
netsurf-a8c540ea597fb17426c5458fa464f9c505c3bda8.tar.bz2
move content specific selection end to content handlers
Diffstat (limited to 'content/handlers/text/textplain.c')
-rw-r--r--content/handlers/text/textplain.c12
1 files changed, 10 insertions, 2 deletions
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,
};