From bc601b8021d1322b49e5f926c42e7d221113ec9d Mon Sep 17 00:00:00 2001 From: arakkk Date: Sat, 26 Aug 2023 07:51:24 +0900 Subject: [PATCH] Fixed error handling when json is invalid. --- autoload/vsnip/source.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/vsnip/source.vim b/autoload/vsnip/source.vim index a6dc972..593386c 100644 --- a/autoload/vsnip/source.vim +++ b/autoload/vsnip/source.vim @@ -36,7 +36,7 @@ function! vsnip#source#create(path) abort let l:file = iconv(l:file, 'utf-8', &encoding) let l:json = json_decode(l:file) - if type(l:json) != type({}) + if type(l:json) != type({}) || json->keys() == "_TYPE_VAL" throw printf('%s is not valid json.', a:path) endif catch /.*/