Compare commits

...

3 Commits

4 changed files with 14 additions and 3 deletions

View File

@ -5,7 +5,7 @@ plugins {
}
group = "com.chylex.intellij.keyboardmaster"
version = "0.1.2"
version = "0.1.3"
repositories {
mavenCentral()

View File

@ -19,8 +19,8 @@ class PluginConfiguration : PersistentStateComponent<PluginConfiguration> {
private val instance: PluginConfiguration
get() = ApplicationManager.getApplication().getService(PluginConfiguration::class.java)
init {
instance.apply(this::update)
fun load() {
instance
}
fun read(callback: (PluginConfiguration) -> Unit) {
@ -42,5 +42,6 @@ class PluginConfiguration : PersistentStateComponent<PluginConfiguration> {
override fun loadState(state: PluginConfiguration) {
XmlSerializerUtil.copyBean(state, this)
update(this)
}
}

View File

@ -1,5 +1,6 @@
package com.chylex.intellij.keyboardmaster.lookup
import com.intellij.codeInsight.lookup.LookupFocusDegree
import com.intellij.codeInsight.lookup.LookupManager
import com.intellij.codeInsight.lookup.impl.LookupImpl
import com.intellij.codeInsight.template.impl.editorActions.TypedActionHandlerBase
@ -46,6 +47,11 @@ class LookupTypedActionHandler(originalHandler: TypedActionHandler?) : TypedActi
lookup.refreshUi(false, true)
}
else {
if (!lookup.isFocused) {
lookup.lookupFocusDegree = LookupFocusDegree.FOCUSED
lookup.refreshUi(false, true)
}
lookup.selectedIndex = offset + shortcutItem - 1
}

View File

@ -22,6 +22,10 @@ class ProjectLookupListener : LookupManagerListener {
val itemShortcutCount
get() = hintTexts.size
init {
PluginConfiguration.load()
}
fun updateShortcuts(configuration: PluginConfiguration) {
hintTexts.clear()
for (char in configuration.codeCompletionItemShortcuts) {