diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-03-22 09:48:08 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-03-22 10:19:13 +0100 |
| commit | fe5ec23a644ac12c6cf7ac3ec1618094db705018 (patch) | |
| tree | 7abfd904f72e166ac716f14fd9553e7ffa922796 /main.c | |
| parent | ad857484fe02d39d08b62c16c32ad2bb4aeba30d (diff) | |
| download | vis-fe5ec23a644ac12c6cf7ac3ec1618094db705018.tar.gz vis-fe5ec23a644ac12c6cf7ac3ec1618094db705018.tar.xz | |
vis: fix wrap around with <C-n>
Do not create an invalid cursor when no further match exists.
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1369,6 +1369,8 @@ static const char *cursors_select_next(Vis *vis, const char *keys, const Arg *ar sel = view_cursors_selection_get(view_cursors(view)); word = text_object_word_find_prev(txt, sel.start, buf); + if (!text_range_valid(&word)) + goto out; size_t pos = text_char_prev(txt, word.end); if ((cursor = view_cursors_new(view, pos))) { view_cursors_selection_set(cursor, &word); |
