refactor(git): extract util.split_lines helper

This commit is contained in:
2026-04-27 13:39:23 +02:00
parent 50697cfe98
commit 4b8d551b0d
5 changed files with 27 additions and 33 deletions
+2 -8
View File
@@ -1,5 +1,6 @@
local log = require("log")
local repo = require("git.repo")
local util = require("util")
local M = {}
@@ -30,14 +31,7 @@ function M.show()
return
end
local lines = vim.split(
result.stdout or "",
"\n",
{ plain = true, trimempty = false }
)
if #lines > 0 and lines[#lines] == "" then
table.remove(lines)
end
local lines = util.split_lines(result.stdout or "")
vim.cmd("new")
local buf = vim.api.nvim_get_current_buf()