فهرست منبع

nixpkgs/neovim: cleanup old patches

Thomas Dy 1 هفته پیش
والد
کامیت
065c624a88
2فایلهای تغییر یافته به همراه0 افزوده شده و 165 حذف شده
  1. 0 105
      .config/nixpkgs/neovim/neovim-32619.patch
  2. 0 60
      .config/nixpkgs/neovim/neovim-34946.patch

+ 0 - 105
.config/nixpkgs/neovim/neovim-32619.patch

@@ -1,105 +0,0 @@
-diff --git a/runtime/lua/vim/treesitter/highlighter.lua b/runtime/lua/vim/treesitter/highlighter.lua
-index db4475e7e4..766f5f5416 100644
---- a/runtime/lua/vim/treesitter/highlighter.lua
-+++ b/runtime/lua/vim/treesitter/highlighter.lua
-@@ -52,11 +52,14 @@ function TSHighlighterQuery:query()
-   return self._query
- end
- 
-+---@alias MarkInfo { start_line: integer, start_col: integer, opts: vim.api.keyset.set_extmark }
-+
- ---@class (private) vim.treesitter.highlighter.State
- ---@field tstree TSTree
- ---@field next_row integer
- ---@field iter vim.treesitter.highlighter.Iter?
- ---@field highlighter_query vim.treesitter.highlighter.Query
-+---@field prev_marks MarkInfo[]
- 
- ---@nodoc
- ---@class vim.treesitter.highlighter
-@@ -220,6 +223,7 @@ function TSHighlighter:prepare_highlight_states(win, srow, erow)
-       next_row = 0,
-       iter = nil,
-       highlighter_query = hl_query,
-+      prev_marks = {},
-     })
-   end)
- end
-@@ -311,6 +315,35 @@ local function get_spell(capture_name)
-   return nil, 0
- end
- 
-+---Adds the mark to the buffer, clipped by the line.
-+---Queues the remainder if the mark continues after the line.
-+---@param m MarkInfo
-+---@param buf integer
-+---@param line integer
-+---@param next_marks MarkInfo[]
-+local function add_mark(m, buf, line, next_marks)
-+  local cur_start_l = m.start_line
-+  local cur_start_c = m.start_col
-+  if cur_start_l < line then
-+    cur_start_l = line
-+    cur_start_c = 0
-+  end
-+
-+  local cur_opts = m.opts
-+  if cur_opts.end_line >= line + 1 then
-+    cur_opts = vim.deepcopy(cur_opts, true)
-+    cur_opts.end_line = line + 1
-+    cur_opts.end_col = 0
-+    table.insert(next_marks, m)
-+  end
-+
-+  local empty = cur_opts.end_line < cur_start_l
-+    or (cur_opts.end_line == cur_start_l and cur_opts.end_col <= cur_start_c)
-+  if cur_start_l <= line and not empty then
-+    api.nvim_buf_set_extmark(buf, ns, cur_start_l, cur_start_c, cur_opts)
-+  end
-+end
-+
- ---@param self vim.treesitter.highlighter
- ---@param win integer
- ---@param buf integer
-@@ -328,6 +361,12 @@ local function on_line_impl(self, win, buf, line, on_spell, on_conceal)
-       return
-     end
- 
-+    local next_marks = {}
-+
-+    for _, mark in ipairs(state.prev_marks) do
-+      add_mark(mark, buf, line, next_marks)
-+    end
-+
-     if state.iter == nil or state.next_row < line then
-       -- Mainly used to skip over folds
- 
-@@ -367,7 +406,7 @@ local function on_line_impl(self, win, buf, line, on_spell, on_conceal)
-         local url = get_url(match, buf, capture, metadata)
- 
-         if hl and end_row >= line and not on_conceal and (not on_spell or spell ~= nil) then
--          api.nvim_buf_set_extmark(buf, ns, start_row, start_col, {
-+          local opts = {
-             end_line = end_row,
-             end_col = end_col,
-             hl_group = hl,
-@@ -376,7 +415,9 @@ local function on_line_impl(self, win, buf, line, on_spell, on_conceal)
-             conceal = conceal,
-             spell = spell,
-             url = url,
--          })
-+          }
-+          local mark = { start_line = start_row, start_col = start_col, opts = opts }
-+          add_mark(mark, buf, line, next_marks)
-         end
- 
-         if
-@@ -395,6 +436,8 @@ local function on_line_impl(self, win, buf, line, on_spell, on_conceal)
-         state.next_row = start_row
-       end
-     end
-+
-+    state.prev_marks = next_marks
-   end)
- end
- 

+ 0 - 60
.config/nixpkgs/neovim/neovim-34946.patch

@@ -1,60 +0,0 @@
-From cad0c71adc30ca4d358cec3146495b340b2e068e Mon Sep 17 00:00:00 2001
-From: Tronikel <contactdonatas@gmail.com>
-Date: Tue, 15 Jul 2025 18:18:50 +0300
-Subject: [PATCH] fix: close floating preview window correctly
-
----
- runtime/lua/vim/lsp/util.lua | 13 +++++++------
- 1 file changed, 7 insertions(+), 6 deletions(-)
-
-diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua
-index db221ddc6889e6..28d00d6cd307f2 100644
---- a/runtime/lua/vim/lsp/util.lua
-+++ b/runtime/lua/vim/lsp/util.lua
-@@ -1418,9 +1418,10 @@ end
- ---
- ---@param events table list of events
- ---@param winnr integer window id of preview window
-----@param bufnrs table list of buffers where the preview window will remain visible
-+---@param floating_bufnr integer floating preview buffer
-+---@param bufnr integer buffer that opened the floating preview buffer
- ---@see autocmd-events
--local function close_preview_autocmd(events, winnr, bufnrs)
-+local function close_preview_autocmd(events, winnr, floating_bufnr, bufnr)
-   local augroup = api.nvim_create_augroup('nvim.preview_window_' .. winnr, {
-     clear = true,
-   })
-@@ -1429,13 +1430,13 @@ local function close_preview_autocmd(events, winnr, bufnrs)
-   -- the floating window buffer or the buffer that spawned it
-   api.nvim_create_autocmd('BufLeave', {
-     group = augroup,
--    buffer = bufnrs[1],
-+    buffer = bufnr,
-     callback = function()
-       vim.schedule(function()
-         -- When jumping to the quickfix window from the preview window,
-         -- do not close the preview window.
-         if api.nvim_get_option_value('filetype', { buf = 0 }) ~= 'qf' then
--          close_preview_window(winnr, bufnrs)
-+          close_preview_window(winnr, { floating_bufnr, bufnr })
-         end
-       end)
-     end,
-@@ -1444,7 +1445,7 @@ local function close_preview_autocmd(events, winnr, bufnrs)
-   if #events > 0 then
-     api.nvim_create_autocmd(events, {
-       group = augroup,
--      buffer = bufnrs[2],
-+      buffer = bufnr,
-       callback = function()
-         close_preview_window(winnr)
-       end,
-@@ -1690,7 +1691,7 @@ function M.open_floating_preview(contents, syntax, opts)
-       '<cmd>bdelete<cr>',
-       { silent = true, noremap = true, nowait = true }
-     )
--    close_preview_autocmd(opts.close_events, floating_winnr, { floating_bufnr, bufnr })
-+    close_preview_autocmd(opts.close_events, floating_winnr, floating_bufnr, bufnr)
- 
-     -- save focus_id
-     if opts.focus_id then