aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorwatiko <service@mail.watiko.net>2016-02-11 18:50:27 +0900
committerwatiko <service@mail.watiko.net>2016-02-11 19:06:54 +0900
commitd115b58cdc66ce3734b928eb310c064d677e8b7d (patch)
treef5c8f03deb6e4cc899c05c46deb2c2ee4929ab8e /src/nvim/syntax.c
parentadb73b60256048cf36a53d6ff714ca9e7c6134bd (diff)
downloadrneovim-d115b58cdc66ce3734b928eb310c064d677e8b7d.tar.gz
rneovim-d115b58cdc66ce3734b928eb310c064d677e8b7d.tar.bz2
rneovim-d115b58cdc66ce3734b928eb310c064d677e8b7d.zip
vim-patch:7.4.828
Problem: Crash when using "syn keyword x c". (Dominique Pelle) Solution: Initialize the keyword tabble. (Raymond Ko, PR 397) https://github.com/vim/vim/commit/670acbc70f371409b46b722bd9a1166e53574f42 --- see: "fix crash due to hash table not being initialized" https://github.com/vim/vim/pull/397 To reproduce: ```sh nvim -u NONE -c ow -c 'sy keyword x c' ```
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index 821411ec7b..baf5d4784d 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -5406,8 +5406,10 @@ void ex_ownsyntax(exarg_T *eap)
if (curwin->w_s == &curwin->w_buffer->b_s) {
curwin->w_s = xmalloc(sizeof(synblock_T));
memset(curwin->w_s, 0, sizeof(synblock_T));
- // TODO: Keep the spell checking as it was.
- curwin->w_p_spell = FALSE; /* No spell checking */
+ hash_init(&curwin->w_s->b_keywtab);
+ hash_init(&curwin->w_s->b_keywtab_ic);
+ // TODO: Keep the spell checking as it was. NOLINT(readability/todo)
+ curwin->w_p_spell = false; // No spell checking
clear_string_option(&curwin->w_s->b_p_spc);
clear_string_option(&curwin->w_s->b_p_spf);
clear_string_option(&curwin->w_s->b_p_spl);