• R
    vi: improve handling of anchored searches · c76c7874
    Ron Yorston 提交于
    Suppose we search for a git conflict marker '<<<<<<< HEAD' using
    the command '/^<<<'.  Using 'n' to go to the next match finds
    '<<<' on the current line, apparently ignoring the '^' anchor.
    
    Set a flag in the compiled regular expression to indicate that the
    start of the string should not be considered a beginning-of-line
    anchor.  An exception has to be made when the search starts from
    the beginning of the file.  Make a similar change for end-of-line
    anchors.
    
    This doesn't affect a default build with VI_REGEX_SEARCH disabled.
    When it's enabled:
    
    function                                             old     new   delta
    char_search                                          247     285     +38
    Signed-off-by: NRon Yorston <rmy@pobox.com>
    Signed-off-by: NDenys Vlasenko <vda.linux@googlemail.com>
    c76c7874
vi.c 124.7 KB