diff options
| author | Georgi Kirilov <in.the@repo> | 2018-10-02 19:10:58 +0300 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-01-26 16:28:36 +0100 |
| commit | 3a1023ee5022071b46f659a82290bb0b3da42137 (patch) | |
| tree | 307ae035f4c1e4e12008e8bed8bd456601f82106 /vis.c | |
| parent | b7013fa7e549162af478d58ffc1f5ed369f58408 (diff) | |
| download | vis-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.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)) |
