mirror of
https://github.com/Eugeny/tabby.git
synced 2024-09-20 01:18:39 +03:00
process #define variables
This commit is contained in:
parent
e3d1d5e61e
commit
953558a866
@ -10,13 +10,23 @@ export class ColorSchemes extends TerminalColorSchemeProvider {
|
||||
|
||||
schemeContents.keys().forEach(schemeFile => {
|
||||
let lines = (schemeContents(schemeFile) as string).split('\n')
|
||||
|
||||
// process #define variables
|
||||
let variables: any = {}
|
||||
lines
|
||||
.filter(x => x.startsWith('#define'))
|
||||
.map(x => x.split(' ').map(v => v.trim()))
|
||||
.forEach(([ignore, variableName, variableValue]) => {
|
||||
variables[variableName] = variableValue
|
||||
})
|
||||
|
||||
let values: any = {}
|
||||
lines
|
||||
.filter(x => x.startsWith('*.'))
|
||||
.map(x => x.substring(2))
|
||||
.map(x => x.split(':').map(v => v.trim()))
|
||||
.forEach(([key, value]) => {
|
||||
values[key] = value
|
||||
values[key] = variables[value] ? variables[value] : value
|
||||
})
|
||||
|
||||
let colors: string[] = []
|
||||
|
Loading…
Reference in New Issue
Block a user