patch 9.1.1240: Regression with ic/ac text objects and comment plugin

Problem:  Regression with ic/ac text objects and comment plugin
Solution: Fix regression, update tests (Maxim Kim)

fix regression: sometimes ic/ac should be line-wise

```
int main() {
    // multilple comments
    // cursor is between them
}

 # dac ->

int main() {
}
```

closes: #16947
closes: #16980

Signed-off-by: Maxim Kim <habamax@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Maxim Kim
2025-03-26 19:04:20 +01:00
committed by Christian Brabandt
parent f9f4e27ad7
commit 08283b28af
3 changed files with 50 additions and 2 deletions

View File

@ -151,7 +151,7 @@ export def ObjComment(inner: bool)
endif
endif
if (pos_end[2] == (getline(pos_end[1])->len() ?? 1)) && pos_start[2] == 1
if (pos_end[2] == (getline(pos_end[1])->len() ?? 1)) && pos_start[2] <= 1
cursor(pos_end[1], 1)
normal! V
cursor(pos_start[1], 1)