diff options
author | James McCoy <jamessan@jamessan.com> | 2018-03-03 16:14:16 -0500 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2018-03-03 22:14:16 +0100 |
commit | c21cf6d3cc74b1ccb27a3f49060497f52c044aaf (patch) | |
tree | 92b6f869120f964ec22414030ad4d805a390c25c | |
parent | 9f994bb69925ed943b17d03f2cad7d5e2c21e992 (diff) | |
download | rneovim-c21cf6d3cc74b1ccb27a3f49060497f52c044aaf.tar.gz rneovim-c21cf6d3cc74b1ccb27a3f49060497f52c044aaf.tar.bz2 rneovim-c21cf6d3cc74b1ccb27a3f49060497f52c044aaf.zip |
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
-rw-r--r-- | src/nvim/syntax.c | 6 |
1 files 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); |