feat: add terminal buffers to selected files (#2077)

Co-authored-by: Samuel Wall <me@samuelwall.uk>
This commit is contained in:
Sam Wall
2025-06-04 18:42:50 +01:00
committed by GitHub
parent 58d08bf0cc
commit 860a479789
2 changed files with 4 additions and 3 deletions

View File

@@ -1094,7 +1094,7 @@ end
---@return string[]|nil lines
---@return string|nil error
function M.read_file_from_buf_or_disk(filepath)
local abs_path = M.join_paths(M.get_project_root(), filepath)
local abs_path = filepath:sub(1, 7) == "term://" and filepath or M.join_paths(M.get_project_root(), filepath)
--- Lookup if the file is loaded in a buffer
local bufnr = vim.fn.bufnr(abs_path)
if bufnr ~= -1 and vim.api.nvim_buf_is_loaded(bufnr) then