vis: Search unexpectedly wraps to file head
In Alpine’s version of the vis editor (v0.5 +curses +lua +acl), using
n/N to skip
between search results frequently causes the cursor to jump to the first occurrence
of the pattern in the file, rather than the next match after the cursor. This
behavior seems to occur most reliably when the pattern contains a multibyte (i.e.
Steps to reproduce:
- Open a file containing multibyte characters and move the cursor to
somewhere near the middle of the file.
- Search for a multibyte character with the / command, e.g. /“
- Use ‘n’ to skip forward to the next match.
Result: The search should skip to the first occurrence of the search
in the entire file.
After discussion on the editor’s IRC channel, it seems that this bug is
only in vis builds compiled on Alpine (i.e. both the packaged version and new
builds from source). It is not present on glibc systems and OpenBSD, to list two
other systems on which the above steps were tried.
(from redmine: issue id 9888, created on 2019-01-21)