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