mirror of
https://github.com/chylex/IntelliJ-Keyboard-Master.git
synced 2025-05-28 17:34:08 +02:00
Fix configuration not loading
This commit is contained in:
parent
2f3780bdfc
commit
798264316b
src/main/kotlin/com/chylex/intellij/keyboardmaster
@ -19,8 +19,8 @@ class PluginConfiguration : PersistentStateComponent<PluginConfiguration> {
|
|||||||
private val instance: PluginConfiguration
|
private val instance: PluginConfiguration
|
||||||
get() = ApplicationManager.getApplication().getService(PluginConfiguration::class.java)
|
get() = ApplicationManager.getApplication().getService(PluginConfiguration::class.java)
|
||||||
|
|
||||||
init {
|
fun load() {
|
||||||
instance.apply(this::update)
|
instance
|
||||||
}
|
}
|
||||||
|
|
||||||
fun read(callback: (PluginConfiguration) -> Unit) {
|
fun read(callback: (PluginConfiguration) -> Unit) {
|
||||||
@ -42,5 +42,6 @@ class PluginConfiguration : PersistentStateComponent<PluginConfiguration> {
|
|||||||
|
|
||||||
override fun loadState(state: PluginConfiguration) {
|
override fun loadState(state: PluginConfiguration) {
|
||||||
XmlSerializerUtil.copyBean(state, this)
|
XmlSerializerUtil.copyBean(state, this)
|
||||||
|
update(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,10 @@ class ProjectLookupListener : LookupManagerListener {
|
|||||||
val itemShortcutCount
|
val itemShortcutCount
|
||||||
get() = hintTexts.size
|
get() = hintTexts.size
|
||||||
|
|
||||||
|
init {
|
||||||
|
PluginConfiguration.load()
|
||||||
|
}
|
||||||
|
|
||||||
fun updateShortcuts(configuration: PluginConfiguration) {
|
fun updateShortcuts(configuration: PluginConfiguration) {
|
||||||
hintTexts.clear()
|
hintTexts.clear()
|
||||||
for (char in configuration.codeCompletionItemShortcuts) {
|
for (char in configuration.codeCompletionItemShortcuts) {
|
||||||
|
Loading…
Reference in New Issue
Block a user