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

Commit

Permalink
Revert closing a session on Ctrl+D.
Browse files Browse the repository at this point in the history
This reverts commit 5d1e980.
  • Loading branch information
vlad-shatskyi committed May 27, 2017
1 parent 5d1e980 commit 134a94a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export enum KeyboardAction {
// pane commands
panePrevious,
paneNext,
paneClose,
// edit/clipboard commands
clipboardCopy,
clipboardCut,
Expand Down
11 changes: 11 additions & 0 deletions src/views/1_ApplicationComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,17 @@ export class ApplicationComponent extends React.Component<{}, ApplicationState>
return;
}

// Close focused pane
if (isKeybindingForEvent(event, KeyboardAction.paneClose) && jobFormComponent) {
this.closeFocusedPane();

this.forceUpdate();

event.stopPropagation();
event.preventDefault();
return;
}

// Change focussed tab
if (isKeybindingForEvent(event, KeyboardAction.tabFocus)) {
const position = parseInt(event.key, 10);
Expand Down
5 changes: 5 additions & 0 deletions src/views/keyevents/Keybindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ export const KeybindingsForActions: KeybindingType[] = [
return (e.ctrlKey && e.keyCode === KeyCode.N) || (e.keyCode === KeyCode.Down);
},
},
// pane command
{
action: KeyboardAction.paneClose,
keybinding: (e: KeyboardEvent) => isMeta(e) && e.keyCode === KeyCode.D,
},
// tab commands
{
action: KeyboardAction.tabFocus,
Expand Down

0 comments on commit 134a94a

Please sign in to comment.