mirror of
https://github.com/lewis6991/gitsigns.nvim
synced 2025-02-25 01:06:53 +00:00
parent
33bda75591
commit
7c493175f3
@ -391,12 +391,21 @@ local function apply_keymaps(bufonly)
|
||||
end
|
||||
|
||||
local function get_buf_path(bufnr)
|
||||
return
|
||||
uv.fs_realpath(api.nvim_buf_get_name(bufnr)) or
|
||||
local file =
|
||||
uv.fs_realpath(api.nvim_buf_get_name(bufnr)) or
|
||||
|
||||
api.nvim_buf_call(bufnr, function()
|
||||
return vim.fn.expand('%:p')
|
||||
end)
|
||||
|
||||
if vim.startswith(file, 'fugitive://') then
|
||||
local orig_path = file
|
||||
file = file:gsub('^fugitive:', ''):gsub('%.git/+%x-/', '')
|
||||
file = uv.fs_realpath(file)
|
||||
dprint(("Fugitive buffer for file '%s' from path '%s'"):format(file, orig_path), bufnr)
|
||||
end
|
||||
|
||||
return file
|
||||
end
|
||||
|
||||
local function index_handler(cbuf)
|
||||
|
@ -391,12 +391,21 @@ local function apply_keymaps(bufonly: boolean)
|
||||
end
|
||||
|
||||
local function get_buf_path(bufnr: integer): string
|
||||
return
|
||||
local file =
|
||||
uv.fs_realpath(api.nvim_buf_get_name(bufnr))
|
||||
or
|
||||
api.nvim_buf_call(bufnr, function(): string
|
||||
return vim.fn.expand('%:p')
|
||||
end)
|
||||
|
||||
if vim.startswith(file, 'fugitive://') then
|
||||
local orig_path = file
|
||||
file = file:gsub('^fugitive:',''):gsub('%.git/+%x-/', '')
|
||||
file = uv.fs_realpath(file)
|
||||
dprint(("Fugitive buffer for file '%s' from path '%s'"):format(file, orig_path), bufnr)
|
||||
end
|
||||
|
||||
return file
|
||||
end
|
||||
|
||||
local function index_handler(cbuf: integer): function
|
||||
|
Loading…
Reference in New Issue
Block a user