From fbb1276ffd45683d4d64a2d99907bdbd3421c16f Mon Sep 17 00:00:00 2001 From: Mykhailo Sabatura <34069301+mishasbtr@users.noreply.github.com> Date: Sat, 8 Jun 2024 23:57:45 +0200 Subject: [PATCH 1/8] fix(extra-lang-angular): add BufNew event to attach angular treesitter (#3522) ## Problem Sometimes angular treesitter didn't get started, e.g. when creating a new file. ## Solution - Add `BufNew` event to attach angular treesitter. - Change `BufRead` to `BufReadPost` for better readability. ### Related Neovim docs - [BufRead / BufReadPost docs](https://neovim.io/doc/user/autocmd.html#BufRead) - [BufNew](https://neovim.io/doc/user/autocmd.html#BufNew) --- lua/lazyvim/plugins/extras/lang/angular.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/lang/angular.lua b/lua/lazyvim/plugins/extras/lang/angular.lua index 9dd82329..f039c3a0 100644 --- a/lua/lazyvim/plugins/extras/lang/angular.lua +++ b/lua/lazyvim/plugins/extras/lang/angular.lua @@ -14,7 +14,7 @@ return { if type(opts.ensure_installed) == "table" then vim.list_extend(opts.ensure_installed, { "angular", "scss" }) end - vim.api.nvim_create_autocmd("BufRead", { + vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, { pattern = { "*.component.html", "*.container.html" }, callback = function() vim.treesitter.start(nil, "angular") From 02dd65cdea1ae34cdf4ca00b20760dbb3cfcd72b Mon Sep 17 00:00:00 2001 From: DrummyFloyd Date: Sun, 9 Jun 2024 07:33:59 +0200 Subject: [PATCH 2/8] fix(helm): missing dependency (#3546) according to this comment https://github.com/LazyVim/LazyVim/commit/ab41ff551b89fde27a0225bc1aa7245bcaec472e#r142924660 --- lua/lazyvim/plugins/extras/lang/helm.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/lang/helm.lua b/lua/lazyvim/plugins/extras/lang/helm.lua index 67ec0b26..58d8bdc8 100644 --- a/lua/lazyvim/plugins/extras/lang/helm.lua +++ b/lua/lazyvim/plugins/extras/lang/helm.lua @@ -6,6 +6,7 @@ return { }) end, + { "towolf/vim-helm", ft = "helm" }, { "nvim-treesitter/nvim-treesitter", opts = { ensure_installed = { "helm" } }, From 28426cc31c0653643f22563fab2f8badb8e8c4cb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 9 Jun 2024 05:34:35 +0000 Subject: [PATCH 3/8] chore(build): auto-generate vimdoc --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 38e4c106..ad712151 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -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* From aa059e0d496e570f898644d3f18bc344ca179d38 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 9 Jun 2024 07:37:09 +0200 Subject: [PATCH 4/8] fix(luasnip): disable nvim-snippets when luasnip is enabled. Fixes #3547 --- lua/lazyvim/plugins/extras/coding/luasnip.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/lazyvim/plugins/extras/coding/luasnip.lua b/lua/lazyvim/plugins/extras/coding/luasnip.lua index bf0b3ea0..f0aadc4f 100644 --- a/lua/lazyvim/plugins/extras/coding/luasnip.lua +++ b/lua/lazyvim/plugins/extras/coding/luasnip.lua @@ -46,4 +46,8 @@ return { { "", function() require("luasnip").jump(-1) end, mode = { "i", "s" } }, }, }, + { + "garymjr/nvim-snippets", + enabled = false, + }, } From 0567b37f61d5ad997793b950c38a6c8f73de3b9b Mon Sep 17 00:00:00 2001 From: Ian <66728045+zspher@users.noreply.github.com> Date: Sun, 9 Jun 2024 14:37:08 +0800 Subject: [PATCH 5/8] fix(lang): neotest not loading rust tests (#3544) fixes https://github.com/LazyVim/LazyVim/issues/3543 --- lua/lazyvim/plugins/extras/lang/rust.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index e5a9acd2..92ac3caf 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -119,12 +119,10 @@ return { { "nvim-neotest/neotest", - optional = true, - opts = function(_, opts) - opts.adapters = opts.adapters or {} - vim.list_extend(opts.adapters, { - require("rustaceanvim.neotest"), - }) - end, + opts = { + adapters = { + ["rustaceanvim.neotest"] = {}, + }, + }, }, } From 547dc76a12309d4dafc970ae08832140eae51cba Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 9 Jun 2024 09:27:29 +0200 Subject: [PATCH 6/8] fix(rust): make neotest optional --- lua/lazyvim/plugins/extras/lang/rust.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lazyvim/plugins/extras/lang/rust.lua b/lua/lazyvim/plugins/extras/lang/rust.lua index 92ac3caf..a24d85f9 100644 --- a/lua/lazyvim/plugins/extras/lang/rust.lua +++ b/lua/lazyvim/plugins/extras/lang/rust.lua @@ -119,6 +119,7 @@ return { { "nvim-neotest/neotest", + optional = true, opts = { adapters = { ["rustaceanvim.neotest"] = {}, From 2848ee492baaffa3c1cf112c17543f077e9fab7f Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 9 Jun 2024 11:36:44 +0200 Subject: [PATCH 7/8] ci: link to discussions --- .github/ISSUE_TEMPLATE/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 3ba13e0c..f861a282 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1 +1,5 @@ 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 From 7793942ebafd32ef90f79e28979898f8013976ff Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sun, 9 Jun 2024 11:42:58 +0200 Subject: [PATCH 8/8] feat(octo): re-open octo windows when restoring session + cleanup --- lua/lazyvim/plugins/extras/util/octo.lua | 55 +++++------------------- lua/lazyvim/util/ui.lua | 18 -------- 2 files changed, 11 insertions(+), 62 deletions(-) diff --git a/lua/lazyvim/plugins/extras/util/octo.lua b/lua/lazyvim/plugins/extras/util/octo.lua index fad1ac25..cc5c47bf 100644 --- a/lua/lazyvim/plugins/extras/util/octo.lua +++ b/lua/lazyvim/plugins/extras/util/octo.lua @@ -48,53 +48,20 @@ return { else LazyVim.error("`octo.nvim` requires `telescope.nvim` or `fzf-lua`") end - local Signs = require("octo.ui.signs") - ---@type {buf: number, from: number, to: number, dirty: boolean}[] - local signs = {} - - local unplace = Signs.unplace - function Signs.unplace(bufnr) - signs = vim.tbl_filter(function(s) - return s.buf ~= bufnr - end, signs) - return unplace(bufnr) - 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 + -- Keep some empty windows in sessions + vim.api.nvim_create_autocmd("ExitPre", { + group = vim.api.nvim_create_augroup("octo_exit_pre", { clear = true }), + callback = function(ev) + local keep = { "octo" } + for _, win in ipairs(vim.api.nvim_list_wins()) do + local buf = vim.api.nvim_win_get_buf(win) + if vim.tbl_contains(keep, vim.bo[buf].filetype) then + vim.bo[buf].buftype = "" -- set buftype to empty to keep the window end - return { { text = corner, texthl = s.dirty and "OctoDirty" or "IblScope" } } end - end - end) + end, + }) end, }, } diff --git a/lua/lazyvim/util/ui.lua b/lua/lazyvim/util/ui.lua index 978a7079..84ab8ab5 100644 --- a/lua/lazyvim/util/ui.lua +++ b/lua/lazyvim/util/ui.lua @@ -1,9 +1,6 @@ ---@class lazyvim.util.ui 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} -- 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 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? local left, right, fold, githl 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 right = s if use_githl then @@ -132,9 +117,6 @@ function M.statuscolumn() left = s end end - if vim.v.virtnum ~= 0 and not has_virtual then - left = nil - end vim.api.nvim_win_call(win, function() if vim.fn.foldclosed(vim.v.lnum) >= 0 then