mirror of
https://github.com/Eugeny/tabby.git
synced 2025-09-24 00:56:06 +00:00
process #define variables
This commit is contained in:
@@ -10,13 +10,23 @@ export class ColorSchemes extends TerminalColorSchemeProvider {
|
|||||||
|
|
||||||
schemeContents.keys().forEach(schemeFile => {
|
schemeContents.keys().forEach(schemeFile => {
|
||||||
let lines = (schemeContents(schemeFile) as string).split('\n')
|
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 = {}
|
let values: any = {}
|
||||||
lines
|
lines
|
||||||
.filter(x => x.startsWith('*.'))
|
.filter(x => x.startsWith('*.'))
|
||||||
.map(x => x.substring(2))
|
.map(x => x.substring(2))
|
||||||
.map(x => x.split(':').map(v => v.trim()))
|
.map(x => x.split(':').map(v => v.trim()))
|
||||||
.forEach(([key, value]) => {
|
.forEach(([key, value]) => {
|
||||||
values[key] = value
|
values[key] = variables[value] ? variables[value] : value
|
||||||
})
|
})
|
||||||
|
|
||||||
let colors: string[] = []
|
let colors: string[] = []
|
||||||
|
Reference in New Issue
Block a user