summaryrefslogtreecommitdiff
path: root/src/misc2.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-08-17 22:14:29 +0200
committerBram Moolenaar <Bram@vim.org>2021-08-17 22:14:29 +0200
commit02f8694a6bd116ab3316add4a7ea6735bf2e8839 (patch)
tree78008d785172ad8fdc40e399401f823839f5f8d6 /src/misc2.c
parentccfb7c6758510e0fe5f390149ea14aee6ff4f55e (diff)
downloadvim-git-02f8694a6bd116ab3316add4a7ea6735bf2e8839.tar.gz
patch 8.2.3357: crash when 'virtualedit' is set and window is narrowv8.2.3357
Problem: Crash when 'virtualedit' is set and window is narrow. () Solution: Check that width is not zero. (closes #8767)
Diffstat (limited to 'src/misc2.c')
-rw-r--r--src/misc2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/misc2.c b/src/misc2.c
index 271014f7a..2436f9fb0 100644
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -161,7 +161,8 @@ coladvance2(
if (finetune
&& curwin->w_p_wrap
&& curwin->w_width != 0
- && wcol >= (colnr_T)width)
+ && wcol >= (colnr_T)width
+ && width > 0)
{
csize = linetabsize(line);
if (csize > 0)