Skip to content

Commit

Permalink
fixup! FormCommit: Replace OnKeyUp & ProcessCmdKey with Hotkeys
Browse files Browse the repository at this point in the history
Review comment: rename hotkeys
  • Loading branch information
mstv committed Mar 17, 2022
1 parent abe3612 commit 552c590
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions GitUI/CommandsDialogs/FormCommit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,11 @@ internal enum Command
CreateBranch = 17,
Refresh = 18,
SelectNext = 19, // Ctrl+N
SelectNext2 = 20, // Alt+Down
SelectNext3 = 21, // Alt+Right
SelectNext_AlternativeHotkey1 = 20, // Alt+Down
SelectNext_AlternativeHotkey2 = 21, // Alt+Right
SelectPrevious = 22, // Ctrl+P
SelectPrevious2 = 23, // Alt+Up
SelectPrevious3 = 24, // Alt+Left
SelectPrevious_AlternativeHotkey1 = 23, // Alt+Up
SelectPrevious_AlternativeHotkey2 = 24, // Alt+Left
}

private string GetShortcutKeyDisplayString(Command cmd)
Expand Down Expand Up @@ -868,11 +868,11 @@ protected override CommandStatus ExecuteCommand(int cmd)
case Command.CreateBranch: createBranchToolStripButton.PerformClick(); return true;
case Command.Refresh: RescanChanges(); return true;
case Command.SelectNext:
case Command.SelectNext2:
case Command.SelectNext3: MoveSelection(1); return true;
case Command.SelectNext_AlternativeHotkey1:
case Command.SelectNext_AlternativeHotkey2: MoveSelection(1); return true;
case Command.SelectPrevious:
case Command.SelectPrevious2:
case Command.SelectPrevious3: MoveSelection(-1); return true;
case Command.SelectPrevious_AlternativeHotkey1:
case Command.SelectPrevious_AlternativeHotkey2: MoveSelection(-1); return true;
default: return base.ExecuteCommand(cmd);
}
}
Expand Down
12 changes: 6 additions & 6 deletions GitUI/Hotkey/HotkeySettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ public static HotkeySettings[] CreateDefaultSettings()
Hk(FormCommit.Command.Refresh, Keys.F5),
Hk(FormCommit.Command.ResetSelectedFiles, Keys.R),
Hk(FormCommit.Command.SelectNext, Keys.Control | Keys.N),
Hk(FormCommit.Command.SelectNext2, Keys.Alt | Keys.Down),
Hk(FormCommit.Command.SelectNext3, Keys.Alt | Keys.Right),
Hk(FormCommit.Command.SelectNext_AlternativeHotkey1, Keys.Alt | Keys.Down),
Hk(FormCommit.Command.SelectNext_AlternativeHotkey2, Keys.Alt | Keys.Right),
Hk(FormCommit.Command.SelectPrevious, Keys.Control | Keys.P),
Hk(FormCommit.Command.SelectPrevious2, Keys.Alt | Keys.Up),
Hk(FormCommit.Command.SelectPrevious3, Keys.Alt | Keys.Left),
Hk(FormCommit.Command.SelectPrevious_AlternativeHotkey1, Keys.Alt | Keys.Up),
Hk(FormCommit.Command.SelectPrevious_AlternativeHotkey2, Keys.Alt | Keys.Left),
Hk(FormCommit.Command.StageSelectedFile, Keys.S),
Hk(FormCommit.Command.UnStageSelectedFile, Keys.U),
Hk(FormCommit.Command.ShowHistory, ShowHistoryHotkey),
Expand Down Expand Up @@ -318,9 +318,9 @@ public static HotkeySettings[] CreateDefaultSettings()
Hk(RevisionGridControl.Command.GoToMergeBase, Keys.Control | Keys.Shift | Keys.K),
Hk(RevisionGridControl.Command.GoToParent, Keys.Control | Keys.P),
Hk(RevisionGridControl.Command.NavigateBackward, Keys.Alt | Keys.Left),
Hk(RevisionGridControl.Command.NavigateBackward2, Keys.BrowserBack),
Hk(RevisionGridControl.Command.NavigateBackward_AlternativeHotkey, Keys.BrowserBack),
Hk(RevisionGridControl.Command.NavigateForward, Keys.Alt | Keys.Right),
Hk(RevisionGridControl.Command.NavigateForward2, Keys.BrowserForward),
Hk(RevisionGridControl.Command.NavigateForward_AlternativeHotkey, Keys.BrowserForward),
Hk(RevisionGridControl.Command.NextQuickSearch, Keys.Alt | Keys.Down),
Hk(RevisionGridControl.Command.OpenCommitsWithDifftool, Keys.None),
Hk(RevisionGridControl.Command.PrevQuickSearch, Keys.Alt | Keys.Up),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ internal enum Command
ResetRevisionFilter = 36,
ResetRevisionPathFilter = 37,
SelectNextForkPointAsDiffBase = 38,
NavigateBackward2 = 39,
NavigateForward2 = 40,
NavigateBackward_AlternativeHotkey = 39,
NavigateForward_AlternativeHotkey = 40,
DeleteRef = 41,
RenameRef = 42,
}
Expand Down
4 changes: 2 additions & 2 deletions GitUI/UserControls/RevisionGrid/RevisionGridControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2846,9 +2846,9 @@ protected override CommandStatus ExecuteCommand(int cmd)
case Command.NextQuickSearch: _quickSearchProvider.NextResult(down: true); break;
case Command.PrevQuickSearch: _quickSearchProvider.NextResult(down: false); break;
case Command.NavigateBackward:
case Command.NavigateBackward2: NavigateBackward(); break;
case Command.NavigateBackward_AlternativeHotkey: NavigateBackward(); break;
case Command.NavigateForward:
case Command.NavigateForward2: NavigateForward(); break;
case Command.NavigateForward_AlternativeHotkey: NavigateForward(); break;
case Command.SelectAsBaseToCompare: selectAsBaseToolStripMenuItem_Click(this, EventArgs.Empty); break;
case Command.CompareToBase: compareToBaseToolStripMenuItem_Click(this, EventArgs.Empty); break;
case Command.CreateFixupCommit: FixupCommitToolStripMenuItemClick(this, EventArgs.Empty); break;
Expand Down

0 comments on commit 552c590

Please sign in to comment.