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"
|
group = "com.chylex.intellij.keyboardmaster"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.chylex.intellij.keyboardmaster.lookup
|
package com.chylex.intellij.keyboardmaster.lookup
|
||||||
|
|
||||||
|
import com.intellij.codeInsight.lookup.LookupFocusDegree
|
||||||
import com.intellij.codeInsight.lookup.LookupManager
|
import com.intellij.codeInsight.lookup.LookupManager
|
||||||
import com.intellij.codeInsight.lookup.impl.LookupImpl
|
import com.intellij.codeInsight.lookup.impl.LookupImpl
|
||||||
import com.intellij.codeInsight.template.impl.editorActions.TypedActionHandlerBase
|
import com.intellij.codeInsight.template.impl.editorActions.TypedActionHandlerBase
|
||||||
|
@ -46,6 +47,11 @@ class LookupTypedActionHandler(originalHandler: TypedActionHandler?) : TypedActi
|
||||||
lookup.refreshUi(false, true)
|
lookup.refreshUi(false, true)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (!lookup.isFocused) {
|
||||||
|
lookup.lookupFocusDegree = LookupFocusDegree.FOCUSED
|
||||||
|
lookup.refreshUi(false, true)
|
||||||
|
}
|
||||||
|
|
||||||
lookup.selectedIndex = offset + shortcutItem - 1
|
lookup.selectedIndex = offset + shortcutItem - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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