Comments (9)
I'm going to back out the previous PR
from jq.vim.
@vito-c (CC @Freed-Wu)
I'm facing this issue, too. Please do not expect autoload scripts in ftdetect scripts.
from jq.vim.
Similar problem like raimon49/requirements.txt.vim#38. What is your minimum vimrc to reproduce?
from jq.vim.
@itchyny does the latest master work for you now?
from jq.vim.
Yes, it works after reverting.
from jq.vim.
Hey, can anyone provide a minimum vimrc to reproduce the bug? I cannot trigger this bug.
from jq.vim.
@itchyny @baod-rate do you happen to have a simplified version of the file you were using?
from jq.vim.
I believe the issue (at least, my issue) is when using lazy.nvim's lazy
setting (see the section: Startup Sequence). Although I imagine this impacts other methods of lazy-loading as well. jq.vim's ftdetect
is sourced in the "handlers" step of lazy's init sequence, regardless of the plugin's lazy
setting. this means that call jq#shebang()
is executed while opening any file:
Lines 1 to 9 in e09bc06
even though autoload/jq.vim
is not (yet) in the runtimepath.
I only thing to do here to fix this is perhaps noting that users should avoid lazy=true
with jq.vim when using lazy.nvim
(and other plugin managers). But perhaps it's best to avoid autoload functions in the ftdetect script altogether, especially since the autocmd loads and executes the function on any buffer anyways.
edit: for the record, a minimal init.lua
to reproduce this error:
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
-- bootstrap lazy.nvim
-- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)
require("lazy").setup({
{
"vito-c/jq.vim",
lazy = true,
tag = "v1.0.3",
ft = "jq",
}
})
from jq.vim.
@baod-rate that is a nice summary of the issue and I think it explains why having the autoload in ftdetect script would cause an error. Thank you for reporting your findings. I have also added support for the jq filetype in vim. So this plugin will get any latest additions but after the next release of vim there the support should be built in. I'm not sure how often neovim pulls in vim changes but I imagine the changes will show up there soon as well.
from jq.vim.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jq.vim.