neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 8a2587be234ccadf3976860a355f1a120c6b2284
parent 834e1181da08c203fa3352ca5f2f492ad7db15ad
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Sat, 30 Aug 2025 08:14:15 +0800

Merge pull request #35546 from zeertzjq/vim-a07a2f4

vim-patch:a07a2f4: runtime(astro): catch json_decode() error when parsing tsconfig.json
Diffstat:
Mruntime/ftplugin/astro.vim | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/runtime/ftplugin/astro.vim b/runtime/ftplugin/astro.vim @@ -3,6 +3,7 @@ " Maintainer: Romain Lafourcade <romainlafourcade@gmail.com> " Last Change: 2024 Apr 21 " 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring') +" 2025 Aug 29 by Vim project, add try/catch around json_decode(), #18141 if exists("b:did_ftplugin") finish @@ -52,13 +53,19 @@ function! s:CollectPathsFromConfig() abort endif endif - let paths_from_config = config_json + try + let paths_from_config = config_json \ ->readfile() \ ->filter({ _, val -> val =~ '^\s*[\[\]{}"0-9]' }) \ ->join() \ ->json_decode() \ ->get('compilerOptions', {}) \ ->get('paths', {}) + catch /^Vim\%((\a\+)\)\=:E491:/ " invalid json + let paths_from_config = {} + catch /^Vim\%((\a\+)\)\=:E474:/ " invalid json in Nvim + let paths_from_config = {} + endtry if !empty(paths_from_config) let b:astro_paths = paths_from_config