mirror of
https://github.com/neovim/neovim.git
synced 2025-09-11 05:48:17 +00:00
vim-patch:8.2.1678: crash when using ":set" after ":ownsyntax"
Problem: Crash when using ":set" after ":ownsyntax".
Solution: Make sure 'spelloptions' is not NULL. (closes vim/vim#6950)
d1f76afaf9
This commit is contained in:
@@ -5588,9 +5588,11 @@ void ex_ownsyntax(exarg_T *eap)
|
|||||||
hash_init(&curwin->w_s->b_keywtab_ic);
|
hash_init(&curwin->w_s->b_keywtab_ic);
|
||||||
// TODO: Keep the spell checking as it was. NOLINT(readability/todo)
|
// TODO: Keep the spell checking as it was. NOLINT(readability/todo)
|
||||||
curwin->w_p_spell = false; // No spell checking
|
curwin->w_p_spell = false; // No spell checking
|
||||||
|
// make sure option values are "empty_option" instead of NULL
|
||||||
clear_string_option(&curwin->w_s->b_p_spc);
|
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_spf);
|
||||||
clear_string_option(&curwin->w_s->b_p_spl);
|
clear_string_option(&curwin->w_s->b_p_spl);
|
||||||
|
clear_string_option(&curwin->w_s->b_p_spo);
|
||||||
clear_string_option(&curwin->w_s->b_syn_isk);
|
clear_string_option(&curwin->w_s->b_syn_isk);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -369,7 +369,11 @@ func Test_ownsyntax()
|
|||||||
call setline(1, '#define FOO')
|
call setline(1, '#define FOO')
|
||||||
syntax on
|
syntax on
|
||||||
set filetype=c
|
set filetype=c
|
||||||
|
|
||||||
ownsyntax perl
|
ownsyntax perl
|
||||||
|
" this should not crash
|
||||||
|
set
|
||||||
|
|
||||||
call assert_equal('perlComment', synIDattr(synID(line('.'), col('.'), 1), 'name'))
|
call assert_equal('perlComment', synIDattr(synID(line('.'), col('.'), 1), 'name'))
|
||||||
call assert_equal('c', b:current_syntax)
|
call assert_equal('c', b:current_syntax)
|
||||||
call assert_equal('perl', w:current_syntax)
|
call assert_equal('perl', w:current_syntax)
|
||||||
|
Reference in New Issue
Block a user