summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2023-05-20 14:07:00 +0100
committerBram Moolenaar <Bram@vim.org>2023-05-20 14:07:00 +0100
commit79cdf026f1b8a16298ee73be497c4bd5f3458cde (patch)
tree2f2381a497126df7030b96450b1b1bfd4257c487 /src/buffer.c
parentbf63011a52a3cc32609ae5945665875062a5ae50 (diff)
patch 9.0.1571: RedrawingDisabled not used consistentlyv9.0.1571
Problem: RedrawingDisabled not used consistently. Solution: Avoid RedrawingDisabled going negative. Set RedrawingDisabled in win_split_ins(). (closes #11961)
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/buffer.c b/src/buffer.c
index dc279ffb19..ff7c50fae1 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -2506,11 +2506,10 @@ buflist_getfile(
}
++RedrawingDisabled;
+ int retval = FAIL;
if (GETFILE_SUCCESS(getfile(buf->b_fnum, NULL, NULL,
(options & GETF_SETMARK), lnum, forceit)))
{
- --RedrawingDisabled;
-
// cursor is at to BOL and w_cursor.lnum is checked due to getfile()
if (!p_sol && col != 0)
{
@@ -2519,10 +2518,12 @@ buflist_getfile(
curwin->w_cursor.coladd = 0;
curwin->w_set_curswant = TRUE;
}
- return OK;
+ retval = OK;
}
- --RedrawingDisabled;
- return FAIL;
+
+ if (RedrawingDisabled > 0)
+ --RedrawingDisabled;
+ return retval;
}
/*