summaryrefslogtreecommitdiff
path: root/src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt
diff options
context:
space:
mode:
authorKyren223 <ulmliad223@gmail.com>2024-08-23 00:31:20 +0300
committerKyren223 <ulmliad223@gmail.com>2024-08-23 00:32:15 +0300
commit7451f83d6685073d10df9bae5c957fdb55dcdc53 (patch)
treedb9a10dcb117263aebcf03b74b5ad68d466d5287 /src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt
parent43346334c56e47e619d40108a07dd8dc651b11fd (diff)
fix: issues with IdeaVim version 2.16.0, everything should work now
Diffstat (limited to 'src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt')
-rw-r--r--src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt134
1 files changed, 67 insertions, 67 deletions
diff --git a/src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt b/src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt
index f6979b1..085c6f2 100644
--- a/src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt
+++ b/src/main/kotlin/me/kyren223/trident/ui/SettingsConfigurable.kt
@@ -1,67 +1,67 @@
-// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
-package me.kyren223.trident.ui
-
-import com.intellij.openapi.options.Configurable
-import com.intellij.openapi.util.NlsContexts.ConfigurableName
-import me.kyren223.trident.data.SettingsData
-import me.kyren223.trident.data.SettingsState
-import javax.swing.JComponent
-
-class SettingsConfigurable : Configurable {
-
- private var settings: SettingsData? = null
-
- override fun getDisplayName(): @ConfigurableName String {
- return "Trident Settings"
- }
-
- override fun createComponent(): JComponent {
- settings = SettingsData()
- return settings!!.panel
- }
-
- override fun isModified(): Boolean {
- val settings = SettingsState.instance
- if (settings.width != this.settings!!.getWidth()) return true
- if (settings.height != this.settings!!.getHeight()) return true
- if (settings.fontSize != this.settings!!.getFontSize()) return true
- if (settings.enterToSelect != this.settings!!.getEnterToSelect()) return true
- if (settings.automaticMapping != this.settings!!.getAutomaticMapping()) return true
- if (settings.automaticReplacing != this.settings!!.getAutomaticReplacing()) return true
- if (settings.recursiveMapping != this.settings!!.getRecursiveMapping()) return true
- if (settings.rememberLine != this.settings!!.getRememberLine()) return true
- if (settings.indexCycling != this.settings!!.getIndexCycling()) return true
- return false
- }
-
- override fun apply() {
- val settings = SettingsState.instance
- settings.width = this.settings!!.getWidth()
- settings.height = this.settings!!.getHeight()
- settings.fontSize = this.settings!!.getFontSize()
- settings.enterToSelect = this.settings!!.getEnterToSelect()
- settings.automaticMapping = this.settings!!.getAutomaticMapping()
- settings.automaticReplacing = this.settings!!.getAutomaticReplacing()
- settings.recursiveMapping = this.settings!!.getRecursiveMapping()
- settings.rememberLine = this.settings!!.getRememberLine()
- settings.indexCycling = this.settings!!.getIndexCycling()
- }
-
- override fun reset() {
- val settings = SettingsState.instance
- if (this.settings == null) this.settings = SettingsData()
- this.settings!!.setWidth(settings.width)
- this.settings!!.setHeight(settings.height)
- this.settings!!.setFontSize(settings.fontSize)
- this.settings!!.setEnterToSelect(settings.enterToSelect)
- this.settings!!.setAutomaticMapping(settings.automaticMapping)
- this.settings!!.setAutomaticReplacing(settings.automaticReplacing)
- this.settings!!.setRecursiveMapping(settings.recursiveMapping)
- this.settings!!.setRememberLine(settings.rememberLine)
- this.settings!!.setIndexCycling(settings.indexCycling)
- }
-
- override fun disposeUIResources() {
- settings = null
- }
-}
+// Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
+package me.kyren223.trident.ui
+
+import com.intellij.openapi.options.Configurable
+import com.intellij.openapi.util.NlsContexts.ConfigurableName
+import me.kyren223.trident.data.SettingsData
+import me.kyren223.trident.data.SettingsState
+import javax.swing.JComponent
+
+class SettingsConfigurable : Configurable {
+
+ private var settings: SettingsData? = null
+
+ override fun getDisplayName(): @ConfigurableName String {
+ return "Trident Settings"
+ }
+
+ override fun createComponent(): JComponent {
+ settings = SettingsData()
+ return settings!!.panel
+ }
+
+ override fun isModified(): Boolean {
+ val settings = SettingsState.instance
+ if (settings.width != this.settings!!.getWidth()) return true
+ if (settings.height != this.settings!!.getHeight()) return true
+ if (settings.fontSize != this.settings!!.getFontSize()) return true
+ if (settings.enterToSelect != this.settings!!.getEnterToSelect()) return true
+ if (settings.automaticMapping != this.settings!!.getAutomaticMapping()) return true
+ if (settings.automaticReplacing != this.settings!!.getAutomaticReplacing()) return true
+ if (settings.recursiveMapping != this.settings!!.getRecursiveMapping()) return true
+ if (settings.rememberLine != this.settings!!.getRememberLine()) return true
+ if (settings.indexCycling != this.settings!!.getIndexCycling()) return true
+ return false
+ }
+
+ override fun apply() {
+ val settings = SettingsState.instance
+ settings.width = this.settings!!.getWidth()
+ settings.height = this.settings!!.getHeight()
+ settings.fontSize = this.settings!!.getFontSize()
+ settings.enterToSelect = this.settings!!.getEnterToSelect()
+ settings.automaticMapping = this.settings!!.getAutomaticMapping()
+ settings.automaticReplacing = this.settings!!.getAutomaticReplacing()
+ settings.recursiveMapping = this.settings!!.getRecursiveMapping()
+ settings.rememberLine = this.settings!!.getRememberLine()
+ settings.indexCycling = this.settings!!.getIndexCycling()
+ }
+
+ override fun reset() {
+ val settings = SettingsState.instance
+ if (this.settings == null) this.settings = SettingsData()
+ this.settings!!.setWidth(settings.width)
+ this.settings!!.setHeight(settings.height)
+ this.settings!!.setFontSize(settings.fontSize)
+ this.settings!!.setEnterToSelect(settings.enterToSelect)
+ this.settings!!.setAutomaticMapping(settings.automaticMapping)
+ this.settings!!.setAutomaticReplacing(settings.automaticReplacing)
+ this.settings!!.setRecursiveMapping(settings.recursiveMapping)
+ this.settings!!.setRememberLine(settings.rememberLine)
+ this.settings!!.setIndexCycling(settings.indexCycling)
+ }
+
+ override fun disposeUIResources() {
+ settings = null
+ }
+}