vim-patch:9.1.1493: manually comparing positions on buffer

Problem:  manually comparing positions on buffer
          (after v9.1.1490)
Solution: use the LTOREQ_POS() macro, fix a few other minor style issues
          (glepnir)

closes: vim/vim#17629

7cf35bc1be

Co-authored-by: glepnir <glephunter@gmail.com>
This commit is contained in:
zeertzjq
2025-07-04 16:23:19 +08:00
parent dd707246fd
commit 9a44bbd574

View File

@ -3988,14 +3988,8 @@ static int expand_pattern_in_buf(char *pat, Direction dir, char ***matches, int
if (compl_started) {
// If we've looped back to an earlier match, stop
if ((dir == FORWARD
&& (cur_match_pos.lnum < prev_match_pos.lnum
|| (cur_match_pos.lnum == prev_match_pos.lnum
&& cur_match_pos.col <= prev_match_pos.col)))
|| (dir == BACKWARD
&& (cur_match_pos.lnum > prev_match_pos.lnum
|| (cur_match_pos.lnum == prev_match_pos.lnum
&& cur_match_pos.col >= prev_match_pos.col)))) {
if ((dir == FORWARD && ltoreq(cur_match_pos, prev_match_pos))
|| (dir == BACKWARD && ltoreq(prev_match_pos, cur_match_pos))) {
if (looped_around) {
break;
} else {