refactor(git): rework module around clearer Status and Repo split

This commit is contained in:
2026-05-06 00:45:56 +02:00
parent 1b43fa6a1c
commit 80d6d465cf
17 changed files with 821 additions and 775 deletions
-44
View File
@@ -1,44 +0,0 @@
if exists("b:current_syntax")
finish
endif
syntax match gitSidebarLabel /\v^(Head|Push)\ze:/
syntax match gitSidebarBranch /\v(^(Head|Push):\s+)@<=\S+/
syntax match gitSidebarAhead /\v\+\d+/
syntax match gitSidebarBehind /\v-\d+/
syntax region gitSidebarUntrackedHeader start=/\v^Untracked>/ end=/\v^$/
syntax region gitSidebarUnstagedHeader start=/\v^Unstaged>/ end=/\v^$/
syntax region gitSidebarStagedHeader start=/\v^Staged>/ end=/\v^$/
syntax region gitSidebarUnmergedHeader start=/\v^Unmerged>/ end=/\v^$/
syntax region gitSidebarUnpushedHeader start=/\v^Unpushed>/ end=/\v^$/
syntax region gitSidebarUnpulledHeader start=/\v^Unpulled>/ end=/\v^$/
syntax match gitSidebarUntrackedLabel /\v^Untracked/ contained containedin=gitSidebarUntrackedHeader
syntax match gitSidebarUnstagedLabel /\v^Unstaged/ contained containedin=gitSidebarUnstagedHeader
syntax match gitSidebarStagedLabel /\v^Staged/ contained containedin=gitSidebarStagedHeader
syntax match gitSidebarUnmergedLabel /\v^Unmerged/ contained containedin=gitSidebarUnmergedHeader
syntax match gitSidebarUnpushedLabel /\v^Unpushed/ contained containedin=gitSidebarUnpushedHeader
syntax match gitSidebarUnpulledLabel /\v^Unpulled/ contained containedin=gitSidebarUnpulledHeader
syntax match gitSidebarHeaderCount /\v\(\zs\d+\ze\)/ contained containedin=gitSidebarUntrackedHeader,
\ gitSidebarUnstagedHeader,
\ gitSidebarStagedHeader,
\ gitSidebarUnmergedHeader,
\ gitSidebarUnpushedHeader,
\ gitSidebarUnpulledHeader
highlight default link gitSidebarLabel Label
highlight default link gitSidebarBranch None
highlight default link gitSidebarAhead GitUnpushed
highlight default link gitSidebarBehind GitUnpulled
highlight default link gitSidebarHeaderCount Number
highlight default link gitSidebarUntrackedLabel gitSidebarLabel
highlight default link gitSidebarUnstagedLabel gitSidebarLabel
highlight default link gitSidebarStagedLabel gitSidebarLabel
highlight default link gitSidebarUnmergedLabel gitSidebarLabel
highlight default link gitSidebarUnpushedLabel gitSidebarLabel
highlight default link gitSidebarUnpulledLabel gitSidebarLabel
let b:current_syntax = "gitSidebar"
+44
View File
@@ -0,0 +1,44 @@
if exists("b:current_syntax")
finish
endif
syntax match gitStatusLabel /\v^(Head|Push)\ze:/
syntax match gitStatusBranch /\v(^(Head|Push):\s+)@<=\S+/
syntax match gitStatusAhead /\v\+\d+/
syntax match gitStatusBehind /\v-\d+/
syntax region gitStatusUntrackedHeader start=/\v^Untracked>/ end=/\v^$/
syntax region gitStatusUnstagedHeader start=/\v^Unstaged>/ end=/\v^$/
syntax region gitStatusStagedHeader start=/\v^Staged>/ end=/\v^$/
syntax region gitStatusUnmergedHeader start=/\v^Unmerged>/ end=/\v^$/
syntax region gitStatusUnpushedHeader start=/\v^Unpushed>/ end=/\v^$/
syntax region gitStatusUnpulledHeader start=/\v^Unpulled>/ end=/\v^$/
syntax match gitStatusUntrackedLabel /\v^Untracked/ contained containedin=gitStatusUntrackedHeader
syntax match gitStatusUnstagedLabel /\v^Unstaged/ contained containedin=gitStatusUnstagedHeader
syntax match gitStatusStagedLabel /\v^Staged/ contained containedin=gitStatusStagedHeader
syntax match gitStatusUnmergedLabel /\v^Unmerged/ contained containedin=gitStatusUnmergedHeader
syntax match gitStatusUnpushedLabel /\v^Unpushed/ contained containedin=gitStatusUnpushedHeader
syntax match gitStatusUnpulledLabel /\v^Unpulled/ contained containedin=gitStatusUnpulledHeader
syntax match gitStatusHeaderCount /\v\(\zs\d+\ze\)/ contained containedin=gitStatusUntrackedHeader,
\ gitStatusUnstagedHeader,
\ gitStatusStagedHeader,
\ gitStatusUnmergedHeader,
\ gitStatusUnpushedHeader,
\ gitStatusUnpulledHeader
highlight default link gitStatusLabel Label
highlight default link gitStatusBranch None
highlight default link gitStatusAhead GitUnpushed
highlight default link gitStatusBehind GitUnpulled
highlight default link gitStatusHeaderCount Number
highlight default link gitStatusUntrackedLabel gitStatusLabel
highlight default link gitStatusUnstagedLabel gitStatusLabel
highlight default link gitStatusStagedLabel gitStatusLabel
highlight default link gitStatusUnmergedLabel gitStatusLabel
highlight default link gitStatusUnpushedLabel gitStatusLabel
highlight default link gitStatusUnpulledLabel gitStatusLabel
let b:current_syntax = "gitStatus"