summaryrefslogtreecommitdiff
path: root/content/handlers/html
diff options
context:
space:
mode:
Diffstat (limited to 'content/handlers/html')
-rw-r--r--content/handlers/html/interaction.c9
-rw-r--r--content/handlers/html/redraw.c3
2 files changed, 3 insertions, 9 deletions
diff --git a/content/handlers/html/interaction.c b/content/handlers/html/interaction.c
index 0a963dd54..79846ae6a 100644
--- a/content/handlers/html/interaction.c
+++ b/content/handlers/html/interaction.c
@@ -1247,7 +1247,7 @@ default_mouse_action(html_content *html,
selection_clear(&html->sel, true);
}
- if (selection_defined(&html->sel)) {
+ if (selection_active(&html->sel)) {
sel_owner.none = false;
html_set_selection(html,
HTML_SELECTION_SELF,
@@ -1586,13 +1586,8 @@ bool html_keypress(struct content *c, uint32_t key)
return true;
case NS_KEY_ESCAPE:
- if (selection_defined(sel)) {
- selection_clear(sel, true);
- return true;
- }
-
/* if there's no selection, leave Escape for the caller */
- return false;
+ return selection_clear(sel, true);
}
return false;
diff --git a/content/handlers/html/redraw.c b/content/handlers/html/redraw.c
index 7c96c908a..08a284b57 100644
--- a/content/handlers/html/redraw.c
+++ b/content/handlers/html/redraw.c
@@ -184,8 +184,7 @@ text_redraw(const char *utf8_text,
unsigned end_idx;
/* first try the browser window's current selection */
- if (selection_defined(sel) &&
- selection_highlighted(sel,
+ if (selection_highlighted(sel,
offset,
offset + len,
&start_idx,