mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-26 19:39:39 -08:00
fix: use Property for mapped locations
This commit is contained in:
parent
b6669a4506
commit
33e3307fc6
|
@ -19,7 +19,7 @@ Display the current path.
|
|||
"background": "#61AFEF",
|
||||
"properties": {
|
||||
"style": "folder",
|
||||
"mappedlocations": [
|
||||
"mapped_locations": [
|
||||
["C:\\temp", "\ue799"]
|
||||
]
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ Display the current path.
|
|||
- folder_icon: `string` - the icon to use as a folder indication - defaults to `..`
|
||||
- windows_registry_icon: `string` - the icon to display when in the Windows registry - defaults to `\uE0B1`
|
||||
- style: `enum` - how to display the current path
|
||||
- mappedlocations: `[]string` - Custom glyph/text for specific paths(only when `style` is set to `agnoster`, `agnosterfull` or `short`)
|
||||
- mapped_locations: `map[string]string` - custom glyph/text for specific paths(only when `style` is set to `agnoster`, `agnosterfull` or `short`)
|
||||
|
||||
## Style
|
||||
|
||||
|
|
|
@ -32,6 +32,8 @@ const (
|
|||
Full string = "full"
|
||||
// Folder displays the current folder
|
||||
Folder string = "folder"
|
||||
// MappedLocations allows overriding certain location with an icon
|
||||
MappedLocations Property = "mapped_locations"
|
||||
)
|
||||
|
||||
func (pt *path) enabled() bool {
|
||||
|
@ -74,7 +76,7 @@ func (pt *path) getShortPath() string {
|
|||
|
||||
// merge custom locations with mapped locations
|
||||
// mapped locations can override predefined locations
|
||||
keyValues := pt.props.getKeyValueMap("mappedlocations", make(map[string]string))
|
||||
keyValues := pt.props.getKeyValueMap(MappedLocations, make(map[string]string))
|
||||
for key, val := range keyValues {
|
||||
mappedLocations[key] = val
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue