mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +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 (compl_started) {
|
||||||
// If we've looped back to an earlier match, stop
|
// If we've looped back to an earlier match, stop
|
||||||
if ((dir == FORWARD
|
if ((dir == FORWARD && ltoreq(cur_match_pos, prev_match_pos))
|
||||||
&& (cur_match_pos.lnum < prev_match_pos.lnum
|
|| (dir == BACKWARD && ltoreq(prev_match_pos, cur_match_pos))) {
|
||||||
|| (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 (looped_around) {
|
if (looped_around) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user