mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user