aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/textobject.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-03-13 07:46:11 +0100
committerGitHub <noreply@github.com>2024-03-13 07:46:11 +0100
commit2a8cef6bd450febd88d754e0c1909137b7451757 (patch)
tree73da66dcd1ba85b22d88b547b58f920039b167ad /src/nvim/textobject.c
parentd5488633f68fcfd58b4bcad654ab103b4746204b (diff)
parent08fc1ebbaa49e3110b65bddeed28d2e61a96f5d9 (diff)
downloadrneovim-2a8cef6bd450febd88d754e0c1909137b7451757.tar.gz
rneovim-2a8cef6bd450febd88d754e0c1909137b7451757.tar.bz2
rneovim-2a8cef6bd450febd88d754e0c1909137b7451757.zip
Merge pull request #27815 from bfredl/setlines_scroll
fix(api/buffer): fix handling of viewport of non-current buffer
Diffstat (limited to 'src/nvim/textobject.c')
-rw-r--r--src/nvim/textobject.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/textobject.c b/src/nvim/textobject.c
index d9c2b3b111..8ac63aad16 100644
--- a/src/nvim/textobject.c
+++ b/src/nvim/textobject.c
@@ -187,7 +187,7 @@ bool findpar(bool *pincl, int dir, int count, int what, bool both)
// skip folded lines
fold_skipped = false;
- if (first && hasFolding(curr, &fold_first, &fold_last)) {
+ if (first && hasFolding(curwin, curr, &fold_first, &fold_last)) {
curr = ((dir > 0) ? fold_last : fold_first) + dir;
fold_skipped = true;
}
@@ -318,8 +318,8 @@ int fwd_word(int count, bool bigword, bool eol)
while (--count >= 0) {
// When inside a range of folded lines, move to the last char of the
// last line.
- if (hasFolding(curwin->w_cursor.lnum, NULL, &curwin->w_cursor.lnum)) {
- coladvance(MAXCOL);
+ if (hasFolding(curwin, curwin->w_cursor.lnum, NULL, &curwin->w_cursor.lnum)) {
+ coladvance(curwin, MAXCOL);
}
int sclass = cls(); // starting class
@@ -374,7 +374,7 @@ int bck_word(int count, bool bigword, bool stop)
while (--count >= 0) {
// When inside a range of folded lines, move to the first char of the
// first line.
- if (hasFolding(curwin->w_cursor.lnum, &curwin->w_cursor.lnum, NULL)) {
+ if (hasFolding(curwin, curwin->w_cursor.lnum, &curwin->w_cursor.lnum, NULL)) {
curwin->w_cursor.col = 0;
}
sclass = cls();
@@ -431,8 +431,8 @@ int end_word(int count, bool bigword, bool stop, bool empty)
while (--count >= 0) {
// When inside a range of folded lines, move to the last char of the
// last line.
- if (hasFolding(curwin->w_cursor.lnum, NULL, &curwin->w_cursor.lnum)) {
- coladvance(MAXCOL);
+ if (hasFolding(curwin, curwin->w_cursor.lnum, NULL, &curwin->w_cursor.lnum)) {
+ coladvance(curwin, MAXCOL);
}
sclass = cls();
if (inc_cursor() == -1) {