Skip to content
This repository was archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Change pane creation mappings. Fixes #1057. [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-shatskyi committed May 27, 2017
1 parent 134a94a commit 8a7027c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
5 changes: 2 additions & 3 deletions src/Enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export enum KeyboardAction {
tabNext,
tabClose,
// pane commands
paneSplitHorizontally,
paneSplitVertically,
panePrevious,
paneNext,
paneClose,
Expand All @@ -130,9 +132,6 @@ export enum KeyboardAction {
editSelectAll,
editFind,
editFindClose,
// window commands
windowSplitHorizontally,
windowSplitVertically,
// view commands
viewReload,
viewToggleFullScreen,
Expand Down
4 changes: 2 additions & 2 deletions src/views/1_ApplicationComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class ApplicationComponent extends React.Component<{}, ApplicationState>
return;
}

if (isMenuShortcut(event)) {
if (isModifierKey(event) || isMenuShortcut(event)) {
return;
}

Expand Down Expand Up @@ -213,7 +213,7 @@ export class ApplicationComponent extends React.Component<{}, ApplicationState>
return;
}

if (currentJob && currentJob.isRunningPty() && !isModifierKey(event)) {
if (currentJob && currentJob.isRunningPty()) {
currentJob.write(event);

event.stopPropagation();
Expand Down
18 changes: 9 additions & 9 deletions src/views/keyevents/Keybindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ export const KeybindingsForMenu: KeybindingMenuType[] = [
action: KeyboardAction.tabClose,
accelerator: `${CmdOrCtrl}+W`,
},
// pane commands
{
action: KeyboardAction.paneSplitHorizontally,
accelerator: `Alt+-`,
},
{
action: KeyboardAction.paneSplitVertically,
accelerator: `Alt+\\`,
},
{
action: KeyboardAction.panePrevious,
accelerator: `Alt+[`,
Expand Down Expand Up @@ -171,15 +180,6 @@ export const KeybindingsForMenu: KeybindingMenuType[] = [
action: KeyboardAction.editFindClose,
accelerator: "Esc",
},
// window commands
{
action: KeyboardAction.windowSplitHorizontally,
accelerator: `${CmdOrCtrl}+-`,
},
{
action: KeyboardAction.windowSplitVertically,
accelerator: `${CmdOrCtrl}+\\`,
},
// view commands
{
action: KeyboardAction.viewReload,
Expand Down
4 changes: 2 additions & 2 deletions src/views/menu/Menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,15 @@ export function buildMenuTemplate(
submenu: [
{
label: "Split Horizontally",
accelerator: getAcceleratorForAction(KeyboardAction.windowSplitHorizontally),
accelerator: getAcceleratorForAction(KeyboardAction.paneSplitHorizontally),
click: () => {
application.focusedTab().addPane(SplitDirection.Horizontal);
application.forceUpdate();
},
},
{
label: "Split Vertically",
accelerator: getAcceleratorForAction(KeyboardAction.windowSplitVertically),
accelerator: getAcceleratorForAction(KeyboardAction.paneSplitVertically),
click: () => {
application.focusedTab().addPane(SplitDirection.Vertical);
application.forceUpdate();
Expand Down

0 comments on commit 8a7027c

Please sign in to comment.