Skip to content

Commit

Permalink
fix: stop vim keys preference disabling on launch (closes #2919)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwouis committed Oct 24, 2023
1 parent 3b0194d commit 53692ff
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ui/preferences-window/tabs/ControlsTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class ControlsTab {
"j": "vimCycleDown"
]
if (sender as! NSButton).state == .on {
if App.app.preferencesWindow != nil && isClearVimKeysSuccessful() {
if isClearVimKeysSuccessful() {
keyActions.forEach { addShortcut(.down, .local, Shortcut(keyEquivalent: $0)!, $1, nil) }
} else {
(sender as! NSButton).state = .off
Expand All @@ -257,7 +257,9 @@ class ControlsTab {
}
}
if !conflicts.isEmpty {
if !shouldClearConflictingShortcuts(conflicts.map { $0.value }) {
// if the app is still launching (App.app.preferencesWindow == nil) and we have a conflict
// then we don't show the user a dialog, and simply disable vim keys
if App.app.preferencesWindow == nil || !shouldClearConflictingShortcuts(conflicts.map { $0.value }) {
return false
}
conflicts.forEach {
Expand Down

0 comments on commit 53692ff

Please sign in to comment.