refactor(git): split status code parsing into status.lua
This commit is contained in:
+2
-11
@@ -1,18 +1,9 @@
|
||||
local repo = require("git.repo")
|
||||
local status = require("git.status")
|
||||
local util = require("git.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
---@param code string
|
||||
---@return string?
|
||||
local function format(code)
|
||||
local char, hl = repo.indicator(code)
|
||||
if not char then
|
||||
return nil
|
||||
end
|
||||
return string.format("%%#%s#%s%%*", hl, char)
|
||||
end
|
||||
|
||||
---@class ow.Git.Repo
|
||||
---@field gitdir string
|
||||
---@field worktree string
|
||||
@@ -89,7 +80,7 @@ local function do_refresh(r)
|
||||
end
|
||||
end
|
||||
statuses[vim.fs.joinpath(r.worktree, path_part)] =
|
||||
format(code)
|
||||
status.format(code)
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user