mirror of
https://github.com/lewis6991/gitsigns.nvim
synced 2024-09-16 14:34:09 +02:00
parent
9ca00df1c8
commit
0dc886637f
4 changed files with 7 additions and 6 deletions
|
@ -253,6 +253,7 @@ M.blame = function()
|
|||
local blm_bo = vim.bo[blm_bufnr]
|
||||
blm_bo.buftype = 'nofile'
|
||||
blm_bo.modifiable = false
|
||||
blm_bo.filetype = 'gitsigns.blame'
|
||||
|
||||
local blm_wlo = vim.wo[blm_win][0]
|
||||
blm_wlo.foldcolumn = '0'
|
||||
|
|
|
@ -19,7 +19,7 @@ local M = {
|
|||
--- @field staged_diffs? Gitsigns.Hunk.Hunk[]
|
||||
--- @field gitdir_watcher? uv.uv_fs_event_t
|
||||
--- @field git_obj Gitsigns.GitObj
|
||||
--- @field blame? table<integer,Gitsigns.BlameInfo|false?>
|
||||
--- @field blame? table<integer,Gitsigns.BlameInfo?>
|
||||
local CacheEntry = M.CacheEntry
|
||||
|
||||
function CacheEntry:get_rev_bufname(rev)
|
||||
|
|
|
@ -79,7 +79,7 @@ local function apply_win_signs(bufnr, top, bot, clear)
|
|||
end
|
||||
end
|
||||
|
||||
--- @param blame table<integer,Gitsigns.BlameInfo|false?>?
|
||||
--- @param blame table<integer,Gitsigns.BlameInfo?>?
|
||||
--- @param first integer
|
||||
--- @param last_orig integer
|
||||
--- @param last_new integer
|
||||
|
@ -91,11 +91,11 @@ local function on_lines_blame(blame, first, last_orig, last_new)
|
|||
if last_new < last_orig then
|
||||
util.list_remove(blame, last_new + 1, last_orig)
|
||||
elseif last_new > last_orig then
|
||||
util.list_insert(blame, last_orig + 1, last_new, false)
|
||||
util.list_insert(blame, last_orig + 1, last_new)
|
||||
end
|
||||
|
||||
for i = first + 1, last_new do
|
||||
blame[i] = false
|
||||
blame[i] = nil
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -327,7 +327,7 @@ end
|
|||
---@param first integer
|
||||
---@param last integer
|
||||
function M.list_remove(t, first, last)
|
||||
local n = #t
|
||||
local n = table.maxn(t)
|
||||
for i = 0, n - first do
|
||||
t[first + i] = t[last + 1 + i]
|
||||
t[last + 1 + i] = nil
|
||||
|
@ -347,7 +347,7 @@ end
|
|||
---@param last integer
|
||||
---@param v any
|
||||
function M.list_insert(t, first, last, v)
|
||||
local n = #t
|
||||
local n = table.maxn(t)
|
||||
|
||||
-- Shift table forward
|
||||
for i = n - first, 0, -1 do
|
||||
|
|
Loading…
Reference in a new issue