aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-29 10:41:40 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-29 10:41:40 +0000
commitf67572208db6314338fdf57faeda9e999673303a (patch)
treef6d2adde090548044ae7ff97a1b55dffffb29849 /render.c
parentrender: wl_subsurface_set_position() uses un-scaled coordinates (diff)
render: search: fix off-by-one error in number of visible characters
Diffstat (limited to 'render.c')
-rw-r--r--render.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/render.c b/render.c
index 6d3e7180..a1162a39 100644
--- a/render.c
+++ b/render.c
@@ -1119,7 +1119,7 @@ render_search_box(struct terminal *term)
pixman_color_t fg = color_hex_to_pixman(term->colors.table[0]);
if (term->search.cursor < glyph_offset ||
- term->search.cursor >= glyph_offset + visible_chars + 2)
+ term->search.cursor >= glyph_offset + visible_chars + 1)
{
/* Make sure cursor is always visible */
term->render.search_glyph_offset = glyph_offset = term->search.cursor;
@@ -1127,7 +1127,7 @@ render_search_box(struct terminal *term)
/* Text (what the user entered - *not* match(es)) */
for (size_t i = glyph_offset;
- i < term->search.len && i - glyph_offset < visible_chars + 1;
+ i < term->search.len && i - glyph_offset < visible_chars;
i++)
{
if (i == term->search.cursor)