From c21cf6d3cc74b1ccb27a3f49060497f52c044aaf Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 3 Mar 2018 16:14:16 -0500 Subject: [PATCH] vim-patch:8.0.1561: crash with rust syntax highligting (#8095) Problem: Crash with rust syntax highligting. (Edd Barrett) Solution: Avoid going past the end of an empty line. https://github.com/vim/vim/commit/069dafc1ded60d9ee0fee4bcecce78ac8a235d87 Closes #6248 --- src/nvim/syntax.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index c3bc009f6a..70a2efb588 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -2133,9 +2133,11 @@ syn_current_attr ( /* nextgroup ends at end of line, unless "skipnl" or "skipempty" present */ if (current_next_list != NULL - && syn_getcurline()[current_col + 1] == NUL - && !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY))) + && (line = syn_getcurline())[current_col] != NUL + && line[current_col + 1] == NUL + && !(current_next_flags & (HL_SKIPNL | HL_SKIPEMPTY))) { current_next_list = NULL; + } if (!GA_EMPTY(&zero_width_next_ga)) ga_clear(&zero_width_next_ga);