aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-11 13:03:24 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 13:03:24 +0100
commited0d135247790f67ead7f1a8c21a020790e80a74 (patch)
treed904008b340bd975c3a80b6cfd4ecfb1a738f4c9 /src
parentdd068928c1c39854a65108366c1a3106cfdb43c5 (diff)
parenta6136e8b0be70efb42801267d11a9e5edca5e377 (diff)
downloadrneovim-ed0d135247790f67ead7f1a8c21a020790e80a74.tar.gz
rneovim-ed0d135247790f67ead7f1a8c21a020790e80a74.tar.bz2
rneovim-ed0d135247790f67ead7f1a8c21a020790e80a74.zip
Merge #7939 "fix crash: 'spell' and long lines"
closes #7937
Diffstat (limited to 'src')
-rw-r--r--src/nvim/screen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nvim/screen.c b/src/nvim/screen.c
index 8a29734025..22cdcc3bef 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -3360,10 +3360,11 @@ win_line (
/* Use nextline[] if possible, it has the start of the
* next line concatenated. */
- if ((prev_ptr - line) - nextlinecol >= 0)
- p = nextline + (prev_ptr - line) - nextlinecol;
- else
+ if ((prev_ptr - line) - nextlinecol >= 0) {
+ p = nextline + ((prev_ptr - line) - nextlinecol);
+ } else {
p = prev_ptr;
+ }
cap_col -= (int)(prev_ptr - line);
size_t tmplen = spell_check(wp, p, &spell_hlf, &cap_col, nochange);
assert(tmplen <= INT_MAX);