Compare commits
3 Commits
2f3780bdfc
...
c9fd077253
Author | SHA1 | Date |
---|---|---|
chylex | c9fd077253 | |
chylex | a3c86f9abc | |
chylex | 798264316b |
|
@ -5,7 +5,7 @@ plugins {
|
|||
}
|
||||
|
||||
group = "com.chylex.intellij.keyboardmaster"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue