fix: key shortcut not working

This commit is contained in:
hstyi
2025-07-19 13:01:31 +08:00
committed by hstyi
parent ae7730fb35
commit 8ec7e416ea

View File

@@ -24,7 +24,7 @@ internal class KeymapRefresher private constructor() : DatabasePropertiesChanged
source: DatabaseChangedExtension.Source
) {
if (type != "Keymap") return
refresh()
refresh(true)
}
override fun onPropertyChanged(name: String, key: String, value: String) {
@@ -33,10 +33,12 @@ internal class KeymapRefresher private constructor() : DatabasePropertiesChanged
refresh()
}
private fun refresh() {
private fun refresh(force: Boolean = false) {
synchronized(this) {
if (currentKeymap == activeKeymapName) {
return
if (force.not()) {
if (currentKeymap == activeKeymapName) {
return
}
}
currentKeymap = activeKeymapName