Skip to content

Commit

Permalink
Reword AlternateMapping -> KeyboardLayout
Browse files Browse the repository at this point in the history
  • Loading branch information
nosami committed Apr 16, 2019
1 parent d0f8dde commit 1825d43
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion XSVim/Addin.fs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type XSVim() as this =
let mutable config = Config.Default
static let searchPads = HashSet<string>()
let initConfig() =
let keyboardMapping = match SettingsPanel.AlternateMapping() with
let keyboardMapping = match SettingsPanel.KeyboardLayout() with
| "Colemak" -> Colemak
| "Dvorak" -> Dvorak
| _ -> Qwerty
Expand Down
2 changes: 1 addition & 1 deletion XSVim/Properties/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ open System.Runtime.CompilerServices
[<AutoOpen>]
module AddinVersion =
[<Literal>]
let version = "0.65.0.80"
let version = "0.65.1.80"

[<assembly: AssemblyTitle("XSVim")>]
// The assembly version has the format {Major}.{Minor}.{Build}.{VSMacVersion}
Expand Down
35 changes: 19 additions & 16 deletions XSVim/SettingsPanel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,30 @@ type SettingsWidget() as this =

let escapeMappingEntryTimeout = new Entry("1000")
let checkDisableAutoCompleteNormalMode =
new CheckButton("Disable intellisense in Normal mode. Use only if you are having issues.",
new CheckButton("Disable intellisense in Normal mode. Use only if you are having issues with the intellisense drop down.",
TooltipText = "Enabling this switches the setting Intellisense on keystroke globally when in Normal mode.")

let labelAlternateMapping =
new Label("Alternate Mapping",
TooltipText = "Select an alternate mapping for when not in insert mode")
let dropDownAlternateMapping =
new ComboBox([| "None"; "Colemak"; "Dvorak" |]);
let labelKeyboardLayout =
new Label("Keyboard Layout",
TooltipText = "Select an keyboard layout for when not in insert mode")
let dropDownKeyboardLayout =
new ComboBox([| "Qwerty"; "Colemak"; "Dvorak" |]);

do
hbox.PackStart labelMapping
hbox.PackStart escapeMappingEntry

let hboxTimeout = new HBox(false, 6)
hboxTimeout.PackStart labelMappingTimeout
hboxTimeout.PackStart escapeMappingEntryTimeout
let hboxAlternate = new HBox(false, 6)
hboxAlternate.PackStart labelAlternateMapping
hboxAlternate.PackStart dropDownAlternateMapping

let hboxKeyboardLayout = new HBox(false, 6)
hboxKeyboardLayout.PackStart labelKeyboardLayout
hboxKeyboardLayout.PackStart dropDownKeyboardLayout

vbox.PackStart hbox
vbox.PackStart hboxTimeout
vbox.PackStart hboxAlternate
vbox.PackStart hboxKeyboardLayout
vbox.Add hbox
vbox.Add checkDisableAutoCompleteNormalMode
this.Add vbox
Expand All @@ -50,15 +53,15 @@ type SettingsWidget() as this =
member this.EscapeMappingEntry = escapeMappingEntry
member this.EscapeMappingEntryTimeout = escapeMappingEntryTimeout
member this.DisableAutoCompleteNormalMode = checkDisableAutoCompleteNormalMode
member this.AlternateMapping = dropDownAlternateMapping
member this.KeyboardLayout = dropDownKeyboardLayout

type SettingsPanel() =
inherit OptionsPanel()
let widget = new SettingsWidget()
static let escapeMappingKey = "VimEscapeMapping"
static let escapeMappingKeyTimeout = "VimEscapeMappingTimeout"
static let disableAutoComplete = "VimDisableAutoComplete"
static let alternateMapping = "VimAlternateMapping"
static let keyboardLayout = "VimAlternateMapping"

static member InsertModeEscapeMapping() =
PropertyService.Get(escapeMappingKey, "")
Expand All @@ -69,16 +72,16 @@ type SettingsPanel() =
static member AutoCompleteInNormalModeIsDisabled() =
PropertyService.Get(disableAutoComplete, false)

static member AlternateMapping() =
PropertyService.Get(alternateMapping, "None")
static member KeyboardLayout() =
PropertyService.Get(keyboardLayout, "Qwerty")

override x.Dispose() = widget.Dispose()

override x.CreatePanelWidget() =
widget.EscapeMappingEntry.Text <- SettingsPanel.InsertModeEscapeMapping()
widget.EscapeMappingEntryTimeout.Text <- SettingsPanel.InsertModeEscapeMappingTimeout() |> string
widget.DisableAutoCompleteNormalMode.Active <- SettingsPanel.AutoCompleteInNormalModeIsDisabled()
widget.AlternateMapping.Active <- match SettingsPanel.AlternateMapping() with
widget.KeyboardLayout.Active <- match SettingsPanel.KeyboardLayout() with
| "Colemak" -> 1
| "Dvorak" -> 2
| _ -> 0
Expand All @@ -94,4 +97,4 @@ type SettingsPanel() =
md.Show()
PropertyService.Set(escapeMappingKeyTimeout, int widget.EscapeMappingEntryTimeout.Text)
PropertyService.Set(disableAutoComplete, widget.DisableAutoCompleteNormalMode.Active)
PropertyService.Set(alternateMapping, widget.AlternateMapping.ActiveText)
PropertyService.Set(keyboardLayout, widget.KeyboardLayout.ActiveText)

0 comments on commit 1825d43

Please sign in to comment.