Component: Use advanced list reloading operation
This commit is contained in:
@ -54,11 +54,9 @@ class ColorSchemeComponent : ConfigFileBasedComponent<NeoColorScheme>(NeoTermPat
|
||||
|
||||
File(baseDir)
|
||||
.listFiles(NEOLANG_FILTER)
|
||||
.mapNotNull { this.loadConfigure(it) }
|
||||
.forEach {
|
||||
val colorScheme = this.loadConfigure(it)
|
||||
if (colorScheme != null) {
|
||||
colors.put(colorScheme.colorName, colorScheme)
|
||||
}
|
||||
colors.put(it.colorName, it)
|
||||
}
|
||||
|
||||
if (colors.containsKey(DefaultColorScheme.colorName)) {
|
||||
|
@ -62,13 +62,10 @@ class ExtraKeyComponent : ConfigFileBasedComponent<NeoExtraKey>(NeoTermPath.EKS_
|
||||
extraKeys.clear()
|
||||
File(baseDir)
|
||||
.listFiles(NEOLANG_FILTER)
|
||||
.filterNot { it.absolutePath != NeoTermPath.EKS_DEFAULT_FILE }
|
||||
.mapNotNull { this.loadConfigure(it) }
|
||||
.forEach {
|
||||
if (it.absolutePath != NeoTermPath.EKS_DEFAULT_FILE) {
|
||||
val extraKey = this.loadConfigure(it)
|
||||
if (extraKey != null) {
|
||||
registerShortcutKeys(extraKey)
|
||||
}
|
||||
}
|
||||
registerShortcutKeys(it)
|
||||
}
|
||||
}
|
||||
}
|
@ -32,7 +32,10 @@ class ProfileComponent : ConfigFileBasedComponent<NeoProfile>(NeoTermPath.PROFIL
|
||||
|
||||
fun reloadProfiles() {
|
||||
profileList.clear()
|
||||
|
||||
File(baseDir)
|
||||
.listFiles(NEOLANG_FILTER)
|
||||
.map { this.loadConfigure(it) }
|
||||
.filterNotNullTo(profileList)
|
||||
}
|
||||
|
||||
fun registerProfile(metaName: String, prototype: Class<out NeoProfile>) {
|
||||
|
Reference in New Issue
Block a user