Compare commits

..

8 Commits

Author SHA1 Message Date
0e16033e9c chore(main): release 8.4.3 (#1573)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-03 18:30:22 +02:00
6cf6b0a624 fix(ui): always pad to 2 cells for status column icons. Fixes #1571 2023-10-03 18:28:05 +02:00
e08813fa11 chore(main): release 8.4.2 (#1570)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-03 18:22:19 +02:00
e105c9daf6 perf(options): better detection for foldtext,statuscolumn,folexpr support 2023-10-03 18:19:32 +02:00
1b74d67a0d fix(ui): fixed foldtext on Neovim < 0.10 2023-10-03 17:35:14 +02:00
b1ad48067e fix(nvim-lint): dont evaluate conditions for linter functions. Fixes #1569 2023-10-03 16:32:05 +02:00
63467c1f21 chore(main): release 8.4.1 (#1568)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-03 15:55:11 +02:00
13e9f6e6b5 fix(ui): check folds of the statuscolumn win instead of current win 2023-10-03 15:53:11 +02:00
4 changed files with 49 additions and 15 deletions

View File

@ -1,5 +1,32 @@
# Changelog
## [8.4.3](https://github.com/LazyVim/LazyVim/compare/v8.4.2...v8.4.3) (2023-10-03)
### Bug Fixes
* **ui:** always pad to 2 cells for status column icons. Fixes [#1571](https://github.com/LazyVim/LazyVim/issues/1571) ([6cf6b0a](https://github.com/LazyVim/LazyVim/commit/6cf6b0a6241c659113f5646ff64fba7dbf5161b9))
## [8.4.2](https://github.com/LazyVim/LazyVim/compare/v8.4.1...v8.4.2) (2023-10-03)
### Bug Fixes
* **nvim-lint:** dont evaluate conditions for linter functions. Fixes [#1569](https://github.com/LazyVim/LazyVim/issues/1569) ([b1ad480](https://github.com/LazyVim/LazyVim/commit/b1ad48067e2c18747bedd7b7054c3ce97ef32890))
* **ui:** fixed foldtext on Neovim &lt; 0.10 ([1b74d67](https://github.com/LazyVim/LazyVim/commit/1b74d67a0d5783e587dedc73a715cb0c9db6cd16))
### Performance Improvements
* **options:** better detection for foldtext,statuscolumn,folexpr support ([e105c9d](https://github.com/LazyVim/LazyVim/commit/e105c9daf6e973b4a294a17b4d2d1882f2188ac6))
## [8.4.1](https://github.com/LazyVim/LazyVim/compare/v8.4.0...v8.4.1) (2023-10-03)
### Bug Fixes
* **ui:** check folds of the statuscolumn win instead of current win ([13e9f6e](https://github.com/LazyVim/LazyVim/commit/13e9f6e6b5b085191b0ecf194ddf4c9e2d3ae6d7))
## [8.4.0](https://github.com/LazyVim/LazyVim/compare/v8.3.0...v8.4.0) (2023-10-03)

View File

@ -62,18 +62,14 @@ end
-- Folding
vim.opt.foldlevel = 99
if vim.treesitter.foldexpr then
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
else
vim.opt.foldmethod = "indent"
end
if vim.treesitter.foldtext then
vim.opt.foldtext = "v:lua.require'lazyvim.util.ui'.foldtext()"
end
vim.opt.foldtext = "v:lua.require'lazyvim.util.ui'.foldtext()"
if vim.fn.has("nvim-0.9.0") == 1 then
vim.opt.foldmethod = "expr"
vim.opt.foldexpr = "v:lua.vim.treesitter.foldexpr()"
vim.opt.statuscolumn = [[%!v:lua.require'lazyvim.util.ui'.statuscolumn()]]
else
vim.opt.foldmethod = "indent"
end
-- Fix markdown indentation settings

View File

@ -49,7 +49,7 @@ return {
ctx.dirname = vim.fn.fnamemodify(ctx.filename, ":h")
names = vim.tbl_filter(function(name)
local linter = lint.linters[name]
return linter and not (linter.condition and not linter.condition(ctx))
return linter and not (type(linter) == "table" and linter.condition and not linter.condition(ctx))
end, names)
if #names > 0 then

View File

@ -15,7 +15,7 @@ end
---@param len? number
function M.icon(sign, len)
sign = sign or {}
len = len or 1
len = len or 2
local text = vim.fn.strcharpart(sign.text or "", 0, len) ---@type string
text = text .. string.rep(" ", len - vim.fn.strchars(text))
return sign.texthl and ("%#" .. sign.texthl .. "#" .. text .. "%*") or text
@ -28,6 +28,15 @@ function M.foldtext()
ret = { { vim.api.nvim_buf_get_lines(0, vim.v.lnum - 1, vim.v.lnum, false)[1], {} } }
end
table.insert(ret, { " " .. require("lazyvim.config").icons.misc.dots })
if not vim.treesitter.foldtext then
return table.concat(
vim.tbl_map(function(line)
return line[1]
end, ret),
" "
)
end
return ret
end
@ -47,9 +56,11 @@ function M.statuscolumn()
end
end
if vim.fn.foldclosed(vim.v.lnum) >= 0 then
fold = { text = vim.opt.fillchars:get().foldclose or "", texthl = "Folded" }
end
vim.api.nvim_win_call(win, function()
if vim.fn.foldclosed(vim.v.lnum) >= 0 then
fold = { text = vim.opt.fillchars:get().foldclose or "", texthl = "Folded" }
end
end)
local nu = ""
if vim.wo[win].number and vim.v.virtnum == 0 then
@ -60,7 +71,7 @@ function M.statuscolumn()
M.icon(left),
[[%=]],
nu .. " ",
M.icon(fold or right, 2),
M.icon(fold or right),
}, "")
end