跳转到主内容

Sapling

非官方测试版翻译

本页面由 PageTurner AI 翻译(测试版)。未经项目官方认可。 发现错误? 报告问题 →

功能

当处于 Sapling 仓库时显示 Sapling 相关信息。

示例配置

{
"type": "sapling",
"style": "powerline",
"powerline_symbol": "",
"foreground": "#193549",
"background": "#4C9642",
"background_templates": [
"{{ if .Bookmark }}#4C9642{{ end }}"
],
"options": {
"fetch_status": true
}
}

选项

信息获取

NameTypeDefaultDescription
fetch_statusbooleantruefetch the local changes - defaults to
native_fallbackbooleanfalsewhen set to true and sl.exe is not available when inside a WSL2 shared Windows drive, we will fallback to the native sl executable to fetch data. Not all information can be displayed in this case
status_formatsmap[string]stringa key, value map allowing to override how individual status items are displayed. For example, "status_formats": { "Added": "Added: %d" } will display the added count as Added: 1 instead of +1. See the Status section for available overrides

模板 (信息)

默认模板
 {{ if .Bookmark }}\uf097 {{ .Bookmark }}*{{ else }}\ue729 {{ .ShortHash }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}

属性

NameTypeDescription
.RepoNamestringthe repo folder name
.WorkingStatuschanges in the worktree (see below)
.Descriptionstringthe first line of the commit's description
.Authorstringthe author of the commit
.Hashstringthe full hash of the commit
.ShortHashstringthe short hash of the commit
.Whenstringthe commit's relative time indication
.Bookmarkstringthe commit's bookmark (if any)
.Dirstringthe repository's root directory
.RelativeDirstringthe current directory relative to the root directory
.Newbooleantrue when there are no commits in the repo

状态标识

NameTypeDescription
.Modifiedintnumber of modified changes
.Addedintnumber of added changes
.Deletedintnumber of removed changes
.Untrackedbooleannumber of untracked changes
.Cleanintnumber of clean changes
.Missingintnumber of missing changes
.Ignoredbooleannumber of ignored changes
.Stringstringa string representation of the changes above

本地变更使用以下语法表示:

IconDescription
~Modified
+Added
-Deleted
?Untracked
=Clean
!Missing
ØIgnored