forked from aniani/vim
patch 8.2.2885: searching for \%'> does not match linewise end of line
Problem: searching for \%'> does not match linewise end of line. (Tim Chase) Solution: Match end of line if column is MAXCOL. (closes #8238)
This commit is contained in:
@@ -3357,17 +3357,29 @@ regmatch(
|
||||
|
||||
pos = getmark_buf(rex.reg_buf, mark, FALSE);
|
||||
if (pos == NULL // mark doesn't exist
|
||||
|| pos->lnum <= 0 // mark isn't set in reg_buf
|
||||
|| (pos->lnum == rex.lnum + rex.reg_firstlnum
|
||||
? (pos->col == (colnr_T)(rex.input - rex.line)
|
||||
|| pos->lnum <= 0) // mark isn't set in reg_buf
|
||||
{
|
||||
status = RA_NOMATCH;
|
||||
}
|
||||
else
|
||||
{
|
||||
colnr_T pos_col = pos->lnum == rex.lnum + rex.reg_firstlnum
|
||||
&& pos->col == MAXCOL
|
||||
? (colnr_T)STRLEN(reg_getline(
|
||||
pos->lnum - rex.reg_firstlnum))
|
||||
: pos->col;
|
||||
|
||||
if ((pos->lnum == rex.lnum + rex.reg_firstlnum
|
||||
? (pos_col == (colnr_T)(rex.input - rex.line)
|
||||
? (cmp == '<' || cmp == '>')
|
||||
: (pos->col < (colnr_T)(rex.input - rex.line)
|
||||
: (pos_col < (colnr_T)(rex.input - rex.line)
|
||||
? cmp != '>'
|
||||
: cmp != '<'))
|
||||
: (pos->lnum < rex.lnum + rex.reg_firstlnum
|
||||
? cmp != '>'
|
||||
: cmp != '<')))
|
||||
status = RA_NOMATCH;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user