refactor(git): hardcode strict_indexing in set_buf_lines
This commit is contained in:
+1
-1
@@ -100,7 +100,7 @@ local function run_in_split(r, args, conf)
|
||||
end
|
||||
end
|
||||
vim.bo[buf].filetype = conf.ft
|
||||
util.buf_set_lines(buf, 0, -1, false, util.split_lines(stdout))
|
||||
util.set_buf_lines(buf, 0, -1, util.split_lines(stdout))
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
@@ -76,11 +76,10 @@ local function populate(buf, r)
|
||||
for i = #hunks, 1, -1 do
|
||||
local sa, ca, sb, cb = unpack(hunks[i])
|
||||
local start = ca == 0 and sa or sa - 1
|
||||
util.buf_set_lines(
|
||||
util.set_buf_lines(
|
||||
buf,
|
||||
start,
|
||||
start + ca,
|
||||
false,
|
||||
vim.list_slice(new_lines, sb, sb + cb - 1)
|
||||
)
|
||||
end
|
||||
|
||||
+1
-1
@@ -199,7 +199,7 @@ local function populate(buf, r, rev, state, rev_sha)
|
||||
end
|
||||
end
|
||||
|
||||
util.buf_set_lines(buf, 0, -1, false, util.split_lines(stdout))
|
||||
util.set_buf_lines(buf, 0, -1, util.split_lines(stdout))
|
||||
state.sha = rev_sha
|
||||
return true
|
||||
end
|
||||
|
||||
@@ -132,7 +132,7 @@ local function render(bufnr, status)
|
||||
end
|
||||
end
|
||||
|
||||
util.buf_set_lines(bufnr, 0, -1, false, lines)
|
||||
util.set_buf_lines(bufnr, 0, -1, lines)
|
||||
vim.api.nvim_buf_clear_namespace(bufnr, ns, 0, -1)
|
||||
for _, m in ipairs(marks) do
|
||||
vim.api.nvim_buf_set_extmark(bufnr, ns, m.row, m.col, {
|
||||
|
||||
+2
-3
@@ -83,12 +83,11 @@ end
|
||||
---@param buf integer
|
||||
---@param start integer
|
||||
---@param end_ integer
|
||||
---@param strict_indexing boolean
|
||||
---@param lines string[]
|
||||
function M.buf_set_lines(buf, start, end_, strict_indexing, lines)
|
||||
function M.set_buf_lines(buf, start, end_, lines)
|
||||
local was_modifiable = vim.bo[buf].modifiable
|
||||
vim.bo[buf].modifiable = true
|
||||
vim.api.nvim_buf_set_lines(buf, start, end_, strict_indexing, lines)
|
||||
vim.api.nvim_buf_set_lines(buf, start, end_, true, lines)
|
||||
vim.bo[buf].modifiable = was_modifiable
|
||||
vim.bo[buf].modified = false
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user