mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Merge branch 'main' into dev
This commit is contained in:
commit
ffa4206337
10 changed files with 173 additions and 64 deletions
2
.github/.release-please-manifest.json
vendored
2
.github/.release-please-manifest.json
vendored
|
|
@ -1,3 +1,3 @@
|
|||
{
|
||||
".": "14.15.1"
|
||||
".": "15.0.3"
|
||||
}
|
||||
|
|
|
|||
77
CHANGELOG.md
77
CHANGELOG.md
|
|
@ -1,5 +1,82 @@
|
|||
# Changelog
|
||||
|
||||
## [15.0.3](https://github.com/LazyVim/LazyVim/compare/v15.0.2...v15.0.3) (2025-09-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **treesitter:** properly update installedd languages after setup ([c28f599](https://github.com/LazyVim/LazyVim/commit/c28f599d4f5d175f3d259a621c4e7b5d0b2a0759))
|
||||
|
||||
## [15.0.2](https://github.com/LazyVim/LazyVim/compare/v15.0.1...v15.0.2) (2025-09-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **python:** remove the wrapping `settings` key from `setup()` options ([#6069](https://github.com/LazyVim/LazyVim/issues/6069)) ([ed3aa74](https://github.com/LazyVim/LazyVim/commit/ed3aa74c107de7dc3e06367ce4afb20056710441))
|
||||
* **treesitter:** indentexpr/foldexpr now work as intended and override ftplugin settings. Fixes [#6447](https://github.com/LazyVim/LazyVim/issues/6447) ([a6b38de](https://github.com/LazyVim/LazyVim/commit/a6b38de763addf2d22e8a43a1e679cc855dc376d))
|
||||
|
||||
## [15.0.1](https://github.com/LazyVim/LazyVim/compare/v15.0.0...v15.0.1) (2025-09-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **treesitter:** TS update during inital build ([2d56d3b](https://github.com/LazyVim/LazyVim/commit/2d56d3b37c275890a403845c00b5c8d38cb387e6))
|
||||
|
||||
## [15.0.0](https://github.com/LazyVim/LazyVim/compare/v14.15.1...v15.0.0) (2025-09-17)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **treesitter:** migrate to `nvim-treesitter` **main** branch
|
||||
* bump Neovim requirement to 0.11.2
|
||||
* LazyVim now requires Neovim >= 0.11 See #6421 for more info
|
||||
|
||||
### Features
|
||||
|
||||
* **blink:** enable blink cmdline completions ([011a35c](https://github.com/LazyVim/LazyVim/commit/011a35ccb810cbe5d25def9cc92271e8423feb74))
|
||||
* **blink:** enable cmdline completions ([ff7c12c](https://github.com/LazyVim/LazyVim/commit/ff7c12c48e23941ffd9a7bbe61857624929ae9da))
|
||||
* bump Neovim requirement to 0.11.2 ([cccfe70](https://github.com/LazyVim/LazyVim/commit/cccfe70ea4390c1915f67ab7d2893971fba3f3fa))
|
||||
* **extras:** added an experimental extra for the treesitter `main` branch ([5668ad7](https://github.com/LazyVim/LazyVim/commit/5668ad72ca806b3a7915bb7b35dcc5cccfe774f7))
|
||||
* LazyVim now requires Neovim >= 0.11 See [#6421](https://github.com/LazyVim/LazyVim/issues/6421) for more info ([e7ce65e](https://github.com/LazyVim/LazyVim/commit/e7ce65e1bb814f79ecb45bfeca934e997e0ee42c))
|
||||
* **lsp:** enable LSP folds when available ([5e2c4e6](https://github.com/LazyVim/LazyVim/commit/5e2c4e62f28a85e0b27d5c97ea92af8c1ab74cef))
|
||||
* **treesitter:** migrate to `nvim-treesitter` **main** branch ([5eac460](https://github.com/LazyVim/LazyVim/commit/5eac460c092103e5516bec345236853b9f35ec7c))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **blink:** make blink completions in cmdline behave more like regular cmdline ([f54fd7f](https://github.com/LazyVim/LazyVim/commit/f54fd7f751e902e824c3a4c9d212a0d18387d0b6))
|
||||
* **catppuccin:** follow renamed integration ([#6354](https://github.com/LazyVim/LazyVim/issues/6354)) ([02d0c9a](https://github.com/LazyVim/LazyVim/commit/02d0c9aebddb902d9c974a38bb44db9bae4eac6d))
|
||||
* **clangd:** file detection improvements ([#6436](https://github.com/LazyVim/LazyVim/issues/6436)) ([aab503f](https://github.com/LazyVim/LazyVim/commit/aab503fda63f34cff6bce229f73ea5209e8afaf0))
|
||||
* **clangd:** rewrite the root_dir function ([#6060](https://github.com/LazyVim/LazyVim/issues/6060)) ([167d39b](https://github.com/LazyVim/LazyVim/commit/167d39b2bef24024be1a48267e14cc6c82146462))
|
||||
* **eslint:** remove old 0.10 code ([919c9e5](https://github.com/LazyVim/LazyVim/commit/919c9e5d091f11b2892c56825249fc4a495d3e8f))
|
||||
* **extras:** disable blink path source in CopilotChat ([#5666](https://github.com/LazyVim/LazyVim/issues/5666)) ([#5754](https://github.com/LazyVim/LazyVim/issues/5754)) ([3aa2916](https://github.com/LazyVim/LazyVim/commit/3aa2916569df2664cb68e1c7c38882868f36f8d0))
|
||||
* **gitsigns:** use silent for gitsigns keymaps ([#5841](https://github.com/LazyVim/LazyVim/issues/5841)) ([6eed178](https://github.com/LazyVim/LazyVim/commit/6eed1781c185ea6d1f313aee60a7097448f473cb))
|
||||
* **grug-far:** add support for GrugFarWithin so it gets loaded by default ([#5772](https://github.com/LazyVim/LazyVim/issues/5772)) ([fd1b02a](https://github.com/LazyVim/LazyVim/commit/fd1b02ae5740dc651cc43291391084dbe7b1b3c4))
|
||||
* **harpoon:** keymaps for 1-9. Fixes [#6319](https://github.com/LazyVim/LazyVim/issues/6319) ([e2ba6bb](https://github.com/LazyVim/LazyVim/commit/e2ba6bb51107cbd076b53b49ed7be99fc2fa3991))
|
||||
* **jdtls:** root_dir ([271fecb](https://github.com/LazyVim/LazyVim/commit/271fecb067ec223a8eab90c1abd1162e9ebae5df))
|
||||
* **jdtls:** root_dir ([#6429](https://github.com/LazyVim/LazyVim/issues/6429)) ([c053921](https://github.com/LazyVim/LazyVim/commit/c05392186e9e540d4af169922c333b5baa583cbe))
|
||||
* **lang.haskell:** prevent Haskell extras from installing telescope.nvim ([#6419](https://github.com/LazyVim/LazyVim/issues/6419)) ([cc4a3e5](https://github.com/LazyVim/LazyVim/commit/cc4a3e556424dba784b41ec3bd92eeb7b62746bc))
|
||||
* **lsp:** buffer should be second arg for supports_method ([44ade7f](https://github.com/LazyVim/LazyVim/commit/44ade7fdea98a0356c64ff9edaf2534547b958bc))
|
||||
* **lspconfig:** remove all references to lspconfig. Closes [#6426](https://github.com/LazyVim/LazyVim/issues/6426) ([23b9cde](https://github.com/LazyVim/LazyVim/commit/23b9cdeb3471b655532e9884fa2dd36ee83062d5))
|
||||
* **lsp:** properly ambiguate denols vs vtsls ([2f75d9a](https://github.com/LazyVim/LazyVim/commit/2f75d9a90fc9cf43f7ba2365dbb745e5595fc02e))
|
||||
* **lsp:** properly register capabilities with new vim.lsp.config. Not needed for blink ([9fa832d](https://github.com/LazyVim/LazyVim/commit/9fa832dc95cb77a5551bbeff12b4520d8b7bdc2a))
|
||||
* **mason:** migrate to mason v2 ([#6053](https://github.com/LazyVim/LazyVim/issues/6053)) ([773f28b](https://github.com/LazyVim/LazyVim/commit/773f28b4912d5505a21da9686d56ab7cf41a9be7))
|
||||
* **mini:** update mini plugin references from echasnovski to nvim-mini ([#6374](https://github.com/LazyVim/LazyVim/issues/6374)) ([ae3aaf2](https://github.com/LazyVim/LazyVim/commit/ae3aaf2dd3a04eb5dbc5b1e34843558c85e45ac2))
|
||||
* **neo-tree:** import neo-tree Extra before edgy Extra ([#5763](https://github.com/LazyVim/LazyVim/issues/5763)) ([848dd31](https://github.com/LazyVim/LazyVim/commit/848dd3132af50f6d211d0c07166ea7c1a4259088))
|
||||
* **ocaml:** use `root_dir` instead of `root_markers` for globs support ([#6428](https://github.com/LazyVim/LazyVim/issues/6428)) ([44cc063](https://github.com/LazyVim/LazyVim/commit/44cc0635bc3d2ccc55eb76bc7668092befcf0536))
|
||||
* **refactoring:** update funcs to return, add `expr=true`, operator mode ([#5882](https://github.com/LazyVim/LazyVim/issues/5882)) ([6e1de74](https://github.com/LazyVim/LazyVim/commit/6e1de74597fa07ea805920da370f9d998740bc5e))
|
||||
* remove 0.9 compat ([3516ae7](https://github.com/LazyVim/LazyVim/commit/3516ae736a333185f6f17b70af20b088d04cbbb6))
|
||||
* **schemastore:** use `before_init` instead of `on_new_config` to load schema store ([#6427](https://github.com/LazyVim/LazyVim/issues/6427)) ([14d2a9b](https://github.com/LazyVim/LazyVim/commit/14d2a9baa1306bd0969112fcf8f69a11840cc5e6))
|
||||
* **treesitter-main:** move exe check to config ([96316e5](https://github.com/LazyVim/LazyVim/commit/96316e5a69b4cc45311f5b7225e7d7bea1f977ee))
|
||||
* **treesitter-main:** set vim.bo.indentexpr in FileType autocmd ([#6430](https://github.com/LazyVim/LazyVim/issues/6430)) ([b926e7d](https://github.com/LazyVim/LazyVim/commit/b926e7db417bc7b0e80feb778bed7924ffe8e85d))
|
||||
* **vue:** `volar` -> `vua_ls`. Fixes [#6236](https://github.com/LazyVim/LazyVim/issues/6236). Closes [#6238](https://github.com/LazyVim/LazyVim/issues/6238). Closes [#6174](https://github.com/LazyVim/LazyVim/issues/6174) ([4a3b4a8](https://github.com/LazyVim/LazyVim/commit/4a3b4a80a89fe5a52d30fbe4afe85c152878ab1b))
|
||||
|
||||
|
||||
### Performance Improvements
|
||||
|
||||
* **blink:** only enable lazydev in lua files ([4961b3d](https://github.com/LazyVim/LazyVim/commit/4961b3d4d4b2999816e978c3ea4ef7c320e4206d))
|
||||
* **treesitter-main:** only enable highlighting for installed treesitter langs ([2f309fc](https://github.com/LazyVim/LazyVim/commit/2f309fc8b5bf93af25293c1e4688d409de718a36))
|
||||
|
||||
## [14.15.1](https://github.com/LazyVim/LazyVim/compare/v14.15.0...v14.15.1) (2025-09-15)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ _G.LazyVim = require("lazyvim.util")
|
|||
---@class LazyVimConfig: LazyVimOptions
|
||||
local M = {}
|
||||
|
||||
M.version = "14.15.1" -- x-release-please-version
|
||||
M.version = "15.0.3" -- x-release-please-version
|
||||
LazyVim.config = M
|
||||
|
||||
---@class LazyVimOptions
|
||||
|
|
|
|||
|
|
@ -68,17 +68,17 @@ opt.fillchars = {
|
|||
diff = "╱",
|
||||
eob = " ",
|
||||
}
|
||||
opt.foldexpr = "v:lua.LazyVim.ui.foldexpr()" -- treesitter folds
|
||||
opt.foldexpr = "v:lua.LazyVim.treesitter.foldexpr()" -- treesitter folds
|
||||
opt.foldlevel = 99
|
||||
opt.foldmethod = "expr"
|
||||
opt.foldtext = ""
|
||||
opt.formatexpr = "v:lua.require'lazyvim.util'.format.formatexpr()"
|
||||
opt.formatexpr = "v:lua.LazyVim.format.formatexpr()"
|
||||
opt.formatoptions = "jcroqlnt" -- tcqj
|
||||
opt.grepformat = "%f:%l:%c:%m"
|
||||
opt.grepprg = "rg --vimgrep"
|
||||
opt.ignorecase = true -- Ignore case
|
||||
opt.inccommand = "nosplit" -- preview incremental substitute
|
||||
opt.indentexpr = "v:lua.LazyVim.ui.indentexpr()" -- treesitter indents
|
||||
opt.indentexpr = "v:lua.LazyVim.treesitter.indentexpr()" -- treesitter indents
|
||||
opt.jumpoptions = "view"
|
||||
opt.laststatus = 3 -- global statusline
|
||||
opt.linebreak = true -- Wrap lines at convenient points
|
||||
|
|
|
|||
|
|
@ -116,10 +116,8 @@ return {
|
|||
"linux-cultist/venv-selector.nvim",
|
||||
cmd = "VenvSelect",
|
||||
opts = {
|
||||
settings = {
|
||||
options = {
|
||||
notify_user_on_venv_activation = true,
|
||||
},
|
||||
options = {
|
||||
notify_user_on_venv_activation = true,
|
||||
},
|
||||
},
|
||||
-- Call config for Python files and load the cached venv automatically
|
||||
|
|
|
|||
|
|
@ -13,13 +13,15 @@ return {
|
|||
LazyVim.error("Please restart Neovim and run `:TSUpdate` to use the `nvim-treesitter` **main** branch.")
|
||||
return
|
||||
end
|
||||
vim.cmd.TSUpdate()
|
||||
TS.update(nil, { summary = true })
|
||||
end,
|
||||
lazy = vim.fn.argc(-1) == 0, -- load treesitter early when opening a file from the cmdline
|
||||
event = { "LazyFile", "VeryLazy" },
|
||||
cmd = { "TSUpdate", "TSInstall", "TSLog", "TSUninstall" },
|
||||
opts_extend = { "ensure_installed" },
|
||||
---@class lazyvim.TSConfig: TSConfig
|
||||
opts = {
|
||||
-- LazyVim config for treesitter
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"c",
|
||||
|
|
@ -47,44 +49,51 @@ return {
|
|||
"yaml",
|
||||
},
|
||||
},
|
||||
---@param plugin LazyPlugin
|
||||
---@param opts TSConfig
|
||||
config = function(plugin, opts)
|
||||
if vim.fn.executable("tree-sitter") == 0 then
|
||||
LazyVim.error({
|
||||
---@param opts lazyvim.TSConfig
|
||||
config = function(_, opts)
|
||||
local TS = require("nvim-treesitter")
|
||||
|
||||
-- some quick sanity checks
|
||||
if not TS.get_installed then
|
||||
return LazyVim.error("Please use `:Lazy` and update `nvim-treesitter`")
|
||||
elseif vim.fn.executable("tree-sitter") == 0 then
|
||||
return LazyVim.error({
|
||||
"**treesitter-main** requires the `tree-sitter` CLI executable to be installed.",
|
||||
"Run `:checkhealth nvim-treesitter` for more information.",
|
||||
})
|
||||
return
|
||||
end
|
||||
if type(opts.ensure_installed) ~= "table" then
|
||||
LazyVim.error("`nvim-treesitter` opts.ensure_installed must be a table")
|
||||
elseif type(opts.ensure_installed) ~= "table" then
|
||||
return LazyVim.error("`nvim-treesitter` opts.ensure_installed must be a table")
|
||||
end
|
||||
|
||||
local TS = require("nvim-treesitter")
|
||||
if not TS.get_installed then
|
||||
LazyVim.error("Please use `:Lazy` and update `nvim-treesitter`")
|
||||
return
|
||||
end
|
||||
-- setup treesitter
|
||||
TS.setup(opts)
|
||||
|
||||
local needed = LazyVim.dedup(opts.ensure_installed --[[@as string[] ]])
|
||||
LazyVim.ui.installed = TS.get_installed("parsers")
|
||||
LazyVim.treesitter.get_installed(true) -- initialize the installed langs
|
||||
|
||||
-- install missing parsers
|
||||
local install = vim.tbl_filter(function(lang)
|
||||
return not LazyVim.ui.have(lang)
|
||||
end, needed)
|
||||
|
||||
return not LazyVim.treesitter.have(lang)
|
||||
end, opts.ensure_installed or {})
|
||||
if #install > 0 then
|
||||
TS.install(install, { summary = true }):await(function()
|
||||
LazyVim.ui.installed = TS.get_installed("parsers")
|
||||
LazyVim.treesitter.get_installed(true) -- refresh the installed langs
|
||||
end)
|
||||
end
|
||||
|
||||
-- treesitter highlighting
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = vim.api.nvim_create_augroup("lazyvim_treesitter", { clear = true }),
|
||||
callback = function(ev)
|
||||
if LazyVim.ui.have(ev.match) then
|
||||
if LazyVim.treesitter.have(ev.match) then
|
||||
pcall(vim.treesitter.start)
|
||||
|
||||
-- check if ftplugins changed foldexpr/indentexpr
|
||||
for _, option in ipairs({ "foldexpr", "indentexpr" }) do
|
||||
local expr = "v:lua.LazyVim.treesitter." .. option .. "()"
|
||||
if vim.opt_global[option]:get() == expr then
|
||||
vim.opt_local[option] = expr
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
---@class lazyvim.util.deprecated
|
||||
local M = {}
|
||||
|
||||
M.moved = {
|
||||
|
|
@ -13,6 +14,7 @@ M.moved = {
|
|||
ui = {
|
||||
statuscolumn = { "Snacks.statuscolumn" },
|
||||
bufremove = { "Snacks.bufdelete" },
|
||||
foldexpr = { "LazyVim.treesitter.foldexpr", stacktrace = false },
|
||||
fg = {
|
||||
"{ fg = Snacks.util.color(...) }",
|
||||
fn = function(...)
|
||||
|
|
@ -28,7 +30,7 @@ function M.decorate(name, mod)
|
|||
if not M.moved[name] then
|
||||
return mod
|
||||
end
|
||||
setmetatable(mod, {
|
||||
return setmetatable(mod, {
|
||||
__call = function(_, ...)
|
||||
local to = M.moved[name].__call[1]
|
||||
LazyVim.deprecate("LazyVim." .. name, to)
|
||||
|
|
@ -38,7 +40,9 @@ function M.decorate(name, mod)
|
|||
__index = function(_, k)
|
||||
if M.moved[name][k] then
|
||||
local to = M.moved[name][k][1]
|
||||
LazyVim.deprecate("LazyVim." .. name .. "." .. k, to)
|
||||
LazyVim.deprecate("LazyVim." .. name .. "." .. k, to, {
|
||||
stacktrace = M.moved[name][k].stacktrace,
|
||||
})
|
||||
if M.moved[name][k].fn then
|
||||
return M.moved[name][k].fn
|
||||
end
|
||||
|
|
@ -55,6 +59,10 @@ function M.lazygit()
|
|||
return Snacks.lazygit
|
||||
end
|
||||
|
||||
function M.ui()
|
||||
return M.decorate("ui", {})
|
||||
end
|
||||
|
||||
function M.toggle()
|
||||
LazyVim.deprecate("LazyVim.toggle", "Snacks.toggle")
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ local LazyUtil = require("lazy.core.util")
|
|||
|
||||
---@class lazyvim.util: LazyUtilCore
|
||||
---@field config LazyVimConfig
|
||||
---@field ui lazyvim.util.ui
|
||||
---@field treesitter lazyvim.util.treesitter
|
||||
---@field lsp lazyvim.util.lsp
|
||||
---@field root lazyvim.util.root
|
||||
---@field terminal lazyvim.util.terminal
|
||||
|
|
@ -16,14 +16,16 @@ local LazyUtil = require("lazy.core.util")
|
|||
---@field mini lazyvim.util.mini
|
||||
---@field pick lazyvim.util.pick
|
||||
---@field cmp lazyvim.util.cmp
|
||||
---@field deprecated lazyvim.util.deprecated
|
||||
local M = {}
|
||||
M.deprecated = require("lazyvim.util.deprecated")
|
||||
|
||||
setmetatable(M, {
|
||||
__index = function(t, k)
|
||||
if LazyUtil[k] then
|
||||
return LazyUtil[k]
|
||||
end
|
||||
if k == "lazygit" or k == "toggle" then -- HACK: special case for lazygit
|
||||
if M.deprecated[k] then
|
||||
return M.deprecated[k]()
|
||||
end
|
||||
---@diagnostic disable-next-line: no-unknown
|
||||
|
|
@ -125,13 +127,17 @@ function M.opts(name)
|
|||
return Plugin.values(plugin, "opts", false)
|
||||
end
|
||||
|
||||
function M.deprecate(old, new)
|
||||
M.warn(("`%s` is deprecated. Please use `%s` instead"):format(old, new), {
|
||||
title = "LazyVim",
|
||||
once = true,
|
||||
stacktrace = true,
|
||||
stacklevel = 6,
|
||||
})
|
||||
---@param opts? LazyNotifyOpts
|
||||
function M.deprecate(old, new, opts)
|
||||
M.warn(
|
||||
("`%s` is deprecated. Please use `%s` instead"):format(old, new),
|
||||
vim.tbl_extend("force", {
|
||||
title = "LazyVim",
|
||||
once = true,
|
||||
stacktrace = true,
|
||||
stacklevel = 6,
|
||||
}, opts or {})
|
||||
)
|
||||
end
|
||||
|
||||
-- delay notifications till vim.notify was replaced or after 500ms
|
||||
|
|
|
|||
33
lua/lazyvim/util/treesitter.lua
Normal file
33
lua/lazyvim/util/treesitter.lua
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
---@class lazyvim.util.treesitter
|
||||
local M = {}
|
||||
|
||||
M._installed = nil ---@type table<string,string>?
|
||||
|
||||
---@param update boolean?
|
||||
function M.get_installed(update)
|
||||
if update then
|
||||
M._installed = {}
|
||||
for _, lang in ipairs(require("nvim-treesitter").get_installed("parsers")) do
|
||||
M._installed[lang] = lang
|
||||
end
|
||||
end
|
||||
return M._installed or {}
|
||||
end
|
||||
|
||||
---@param ft string
|
||||
function M.have(ft)
|
||||
local lang = vim.treesitter.language.get_lang(ft)
|
||||
return lang and M.get_installed()[lang]
|
||||
end
|
||||
|
||||
function M.foldexpr()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
return M.have(vim.bo[buf].filetype) and vim.treesitter.foldexpr() or "0"
|
||||
end
|
||||
|
||||
function M.indentexpr()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
return M.have(vim.bo[buf].filetype) and require("nvim-treesitter").indentexpr() or -1
|
||||
end
|
||||
|
||||
return M
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
---@class lazyvim.util.ui
|
||||
local M = {}
|
||||
|
||||
M.installed = {} ---@type string[]
|
||||
|
||||
---@param ft string
|
||||
function M.have(ft)
|
||||
local lang = vim.treesitter.language.get_lang(ft)
|
||||
return vim.tbl_contains(M.installed, lang)
|
||||
end
|
||||
|
||||
function M.foldexpr()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
return M.have(vim.b[buf].filetype) and vim.treesitter.foldexpr() or "0"
|
||||
end
|
||||
|
||||
function M.indentexpr()
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
return M.have(vim.b[buf].filetype) and require("nvim-treesitter").indentexpr() or -1
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Reference in a new issue