Open pacaunt opened 3 months ago
Here is my source code
Hmmm, interestingly I did not manage to reproduce your issue but it looked like it is a vim.fn.json_decode
. I've switched to the lua version vim.json.decode
and I'd appreciate it if you can test this out to see if it fixed your problem.
I tried changing the function according to your git commit and the following error messages appeared:
Error executing vim.schedule lua callback: ...typst-preview.nvim/lua/typst-preview/servers/factory.lua:166: attempt to perfo
rm arithmetic on local 's' (a nil value)
stack traceback:
...typst-preview.nvim/lua/typst-preview/servers/factory.lua:166: in function ''
vim/_editor.lua: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue
Error executing vim.schedule lua callback: ...typst-preview.nvim/lua/typst-preview/servers/factory.lua:166: Expected value b
ut found invalid token at character 1
stack traceback:
[C]: in function 'decode'
...typst-preview.nvim/lua/typst-preview/servers/factory.lua:166: in function ''
vim/_editor.lua: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue
Error executing vim.schedule lua callback: ...typst-preview.nvim/lua/typst-preview/servers/factory.lua:166: attempt to perfo
rm arithmetic on local 's' (a nil value)
stack traceback:
...typst-preview.nvim/lua/typst-preview/servers/factory.lua:166: in function ''
vim/_editor.lua: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue
Error executing vim.schedule lua callback: ...typst-preview.nvim/lua/typst-preview/servers/factory.lua:166: Expected value b
ut found invalid token at character 1
stack traceback:
[C]: in function 'decode'
...typst-preview.nvim/lua/typst-preview/servers/factory.lua:166: in function ''
vim/_editor.lua: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
May be the error was in my editor? Because I separate the configuration file and the plugins as
-- lua/core
-- plugins.lua
-- plugin_config
-- init.lua
-- typst-preview.lua
-- init.lua
This is my plugins.lua
file:
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'ellisonleao/gruvbox.nvim'
use 'nvim-tree/nvim-tree.lua'
use 'nvim-tree/nvim-web-devicons'
use 'nvim-lualine/lualine.nvim'
use {
'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate'
}
use {
'nvim-telescope/telescope.nvim', tag = '0.1.6',
requires = { {'nvim-lua/plenary.nvim'} }
}
use {
'chomosuke/typst-preview.nvim',
tag = 'v0.3.*',
run = function() require 'typst-preview'.update() end,
}
use {
"windwp/nvim-autopairs",
event = "InsertEnter",
run = vim.cmd[[packadd! nvim-autopairs]],
config = function()
require("nvim-autopairs").setup {}
end,
}
use {
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
}
use 'hrsh7th/cmp-nvim-lsp'
use 'hrsh7th/cmp-buffer'
use 'hrsh7th/cmp-path'
use 'hrsh7th/cmp-cmdline'
use 'hrsh7th/nvim-cmp'
use 'hrsh7th/cmp-vsnip'
use 'hrsh7th/vim-vsnip'
use {'kaarmu/typst.vim', ft = {'typst'},opt = false }
if packer_bootstrap then
require('packer').sync()
end
end)
The same thing happens to me despite not having non-latin script. @pacaunt how did you get the full stack trace out, without the ..? I want to see what characters are causing me issues.
After running the command
TypstPreview
the system said:with a multiple stack of
How I can solve this ?