From 3a1023ee5022071b46f659a82290bb0b3da42137 Mon Sep 17 00:00:00 2001 From: Georgi Kirilov Date: Tue, 2 Oct 2018 19:10:58 +0300 Subject: vis: don't search off screen when highlighting matches --- vis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vis.c') 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)) -- cgit v1.2.3