Use highlighted_string function to define segments
This commit is contained in:
parent
576971c5f1
commit
3ebf9c1a81
|
@ -12,6 +12,16 @@ import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def highlighted_string(s, group, **kwargs):
|
||||||
|
ret = {
|
||||||
|
'type': 'string',
|
||||||
|
'contents': s,
|
||||||
|
'highlight_group': [group],
|
||||||
|
}
|
||||||
|
ret.update(kwargs)
|
||||||
|
return ret
|
||||||
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'config': {
|
'config': {
|
||||||
'common': {
|
'common': {
|
||||||
|
@ -64,26 +74,11 @@ config = {
|
||||||
'themes/test/default': {
|
'themes/test/default': {
|
||||||
'segments': {
|
'segments': {
|
||||||
'left': [
|
'left': [
|
||||||
{
|
highlighted_string('s', 'str1', width='auto'),
|
||||||
'type': 'string',
|
highlighted_string('g', 'str2'),
|
||||||
'contents': 's',
|
|
||||||
'width': 'auto',
|
|
||||||
'highlight_group': ['str1'],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'type': 'string',
|
|
||||||
'contents': 'g',
|
|
||||||
'highlight_group': ['str2'],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
'right': [
|
'right': [
|
||||||
{
|
highlighted_string('f', 'str2', width='auto', align='right'),
|
||||||
'type': 'string',
|
|
||||||
'contents': 'f',
|
|
||||||
'width': 'auto',
|
|
||||||
'align': 'right',
|
|
||||||
'highlight_group': ['str2'],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue