aboutsummaryrefslogtreecommitdiff
path: root/vis.c
diff options
context:
space:
mode:
authorGeorgi Kirilov <in.the@repo>2018-10-02 19:10:58 +0300
committerMarc André Tanner <mat@brain-dump.org>2020-01-26 16:28:36 +0100
commit3a1023ee5022071b46f659a82290bb0b3da42137 (patch)
tree307ae035f4c1e4e12008e8bed8bd456601f82106 /vis.c
parentb7013fa7e549162af478d58ffc1f5ed369f58408 (diff)
downloadvis-3a1023ee5022071b46f659a82290bb0b3da42137.tar.gz
vis-3a1023ee5022071b46f659a82290bb0b3da42137.tar.xz
vis: don't search off screen when highlighting matches
Diffstat (limited to 'vis.c')
-rw-r--r--vis.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/vis.c b/vis.c
index 03b01ab..2c53f1a 100644
--- a/vis.c
+++ b/vis.c
@@ -371,7 +371,8 @@ static void window_draw_cursor_matching(Win *win, Selection *cur, CellStyle *sty
return;
Line *line_match; int col_match;
size_t pos = view_cursors_pos(cur);
- size_t pos_match = text_bracket_match_symbol(win->file->text, pos, "(){}[]\"'`");
+ Filerange limits = view_viewport_get(win->view);
+ size_t pos_match = text_bracket_match_symbol(win->file->text, pos, "(){}[]\"'`", &limits);
if (pos == pos_match)
return;
if (!view_coord_get(win->view, pos_match, &line_match, NULL, &col_match))