Merge branch 'main' into php

This commit is contained in:
Muneeb Usmani 2024-06-09 19:00:41 +05:00 committed by GitHub
commit 676cc45b33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 27 additions and 70 deletions

View file

@ -1 +1,5 @@
blank_issues_enabled: false blank_issues_enabled: false
contact_links:
- name: Ask a question or start a discussion
url: https://github.com/LazyVim/LazyVim/discussions
about: Use Github discussions instead

View file

@ -1,4 +1,4 @@
*LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 08 *LazyVim.txt* For Neovim >= 0.9.0 Last change: 2024 June 09
============================================================================== ==============================================================================
Table of Contents *LazyVim-table-of-contents* Table of Contents *LazyVim-table-of-contents*

View file

@ -46,4 +46,8 @@ return {
{ "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, { "<s-tab>", function() require("luasnip").jump(-1) end, mode = { "i", "s" } },
}, },
}, },
{
"garymjr/nvim-snippets",
enabled = false,
},
} }

View file

@ -14,7 +14,7 @@ return {
if type(opts.ensure_installed) == "table" then if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, { "angular", "scss" }) vim.list_extend(opts.ensure_installed, { "angular", "scss" })
end end
vim.api.nvim_create_autocmd("BufRead", { vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
pattern = { "*.component.html", "*.container.html" }, pattern = { "*.component.html", "*.container.html" },
callback = function() callback = function()
vim.treesitter.start(nil, "angular") vim.treesitter.start(nil, "angular")

View file

@ -6,6 +6,7 @@ return {
}) })
end, end,
{ "towolf/vim-helm", ft = "helm" },
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
opts = { ensure_installed = { "helm" } }, opts = { ensure_installed = { "helm" } },

View file

@ -120,11 +120,10 @@ return {
{ {
"nvim-neotest/neotest", "nvim-neotest/neotest",
optional = true, optional = true,
opts = function(_, opts) opts = {
opts.adapters = opts.adapters or {} adapters = {
vim.list_extend(opts.adapters, { ["rustaceanvim.neotest"] = {},
require("rustaceanvim.neotest"), },
}) },
end,
}, },
} }

View file

@ -48,53 +48,20 @@ return {
else else
LazyVim.error("`octo.nvim` requires `telescope.nvim` or `fzf-lua`") LazyVim.error("`octo.nvim` requires `telescope.nvim` or `fzf-lua`")
end end
local Signs = require("octo.ui.signs")
---@type {buf: number, from: number, to: number, dirty: boolean}[] -- Keep some empty windows in sessions
local signs = {} vim.api.nvim_create_autocmd("ExitPre", {
group = vim.api.nvim_create_augroup("octo_exit_pre", { clear = true }),
local unplace = Signs.unplace callback = function(ev)
function Signs.unplace(bufnr) local keep = { "octo" }
signs = vim.tbl_filter(function(s) for _, win in ipairs(vim.api.nvim_list_wins()) do
return s.buf ~= bufnr local buf = vim.api.nvim_win_get_buf(win)
end, signs) if vim.tbl_contains(keep, vim.bo[buf].filetype) then
return unplace(bufnr) vim.bo[buf].buftype = "" -- set buftype to empty to keep the window
end
function Signs.place_signs(bufnr, start_line, end_line, is_dirty)
signs[#signs + 1] = { buf = bufnr, from = start_line, to = end_line, dirty = is_dirty }
end
-- stylua: ignore
local corners = {
top = "┌╴",
middle = "",
last = "└╴",
single = "[ ",
}
--- Fixes octo's comment rendering to take wrapping into account
---@param buf number
---@param lnum number
---@param vnum number
---@param win number
table.insert(LazyVim.ui.virtual, function(buf, lnum, vnum, win)
lnum = lnum - 1
for _, s in ipairs(signs) do
if buf == s.buf and lnum >= s.from and lnum <= s.to then
local height = vim.api.nvim_win_text_height(win, { start_row = s.from, end_row = s.to }).all
local height_end = vim.api.nvim_win_text_height(win, { start_row = s.to, end_row = s.to }).all
local corner = corners.middle
if height == 1 then
corner = corners.single
elseif lnum == s.from and vnum == 0 then
corner = corners.top
elseif lnum == s.to and vnum == height_end - 1 then
corner = corners.last
end end
return { { text = corner, texthl = s.dirty and "OctoDirty" or "IblScope" } }
end end
end end,
end) })
end, end,
}, },
} }

View file

@ -1,9 +1,6 @@
---@class lazyvim.util.ui ---@class lazyvim.util.ui
local M = {} local M = {}
---@type (fun(buf:number, lnum:number, vnum:number, win:number):Sign[]?)[]
M.virtual = {}
---@alias Sign {name:string, text:string, texthl:string, priority:number} ---@alias Sign {name:string, text:string, texthl:string, priority:number}
-- Returns a list of regular and extmark signs sorted by priority (low to high) -- Returns a list of regular and extmark signs sorted by priority (low to high)
@ -108,21 +105,9 @@ function M.statuscolumn()
if show_signs then if show_signs then
local signs = M.get_signs(buf, vim.v.lnum) local signs = M.get_signs(buf, vim.v.lnum)
local has_virtual = false
for _, fn in ipairs(M.virtual) do
local virtual = fn(buf, vim.v.lnum, vim.v.virtnum, win)
if virtual then
has_virtual = true
vim.list_extend(signs, virtual)
end
end
---@type Sign?,Sign?,Sign? ---@type Sign?,Sign?,Sign?
local left, right, fold, githl local left, right, fold, githl
for _, s in ipairs(signs) do for _, s in ipairs(signs) do
if s.name and s.name:lower():find("^octo_clean") then
s.texthl = "IblScope"
end
if s.name and (s.name:find("GitSign") or s.name:find("MiniDiffSign")) then if s.name and (s.name:find("GitSign") or s.name:find("MiniDiffSign")) then
right = s right = s
if use_githl then if use_githl then
@ -132,9 +117,6 @@ function M.statuscolumn()
left = s left = s
end end
end end
if vim.v.virtnum ~= 0 and not has_virtual then
left = nil
end
vim.api.nvim_win_call(win, function() vim.api.nvim_win_call(win, function()
if vim.fn.foldclosed(vim.v.lnum) >= 0 then if vim.fn.foldclosed(vim.v.lnum) >= 0 then