aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-11 13:04:39 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 13:04:39 +0100
commit2cfc1b055bba6bb0f7e263a69079c7f52303a78a (patch)
treecf8c16ab35c825450ef8ad94a4dc22f7e7753ea9 /src
parent564ad60c0624941bdd63a6ed026cd03573c46f5a (diff)
parented0d135247790f67ead7f1a8c21a020790e80a74 (diff)
downloadrneovim-2cfc1b055bba6bb0f7e263a69079c7f52303a78a.tar.gz
rneovim-2cfc1b055bba6bb0f7e263a69079c7f52303a78a.tar.bz2
rneovim-2cfc1b055bba6bb0f7e263a69079c7f52303a78a.zip
Merge #7939 "fix crash: 'spell' and long lines"
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 122f760c51..238d9a92a6 100644
--- a/src/nvim/screen.c
+++ b/src/nvim/screen.c
@@ -3353,10 +3353,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);