Skip to content

Commit

Permalink
Add Increase Column and Decrease Column function
Browse files Browse the repository at this point in the history
  • Loading branch information
salexkidd committed Jan 2, 2016
1 parent 04f7271 commit 47041ce
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 6 deletions.
16 changes: 14 additions & 2 deletions Interfaces/MainMenu.xib
Expand Up @@ -961,13 +961,25 @@ DQ
<menuItem title="Decrease Row" keyEquivalent="" id="E89-Mw-yOH">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="shrinkRow:" target="-1" id="tdy-uB-OZJ"/>
<action selector="decreaseRow:" target="-1" id="cNH-bz-I6n"/>
</connections>
</menuItem>
<menuItem title="Increase Row" keyEquivalent="" id="1L5-Nc-laa">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="expandRow:" target="-1" id="pS5-lB-FrP"/>
<action selector="increaseRow:" target="-1" id="33c-SV-e65"/>
</connections>
</menuItem>
<menuItem title="Decrease Column" id="XkO-DN-h6r">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="decreaseColumn:" target="-1" id="8x7-l6-wYq"/>
</connections>
</menuItem>
<menuItem title="Increase Column" id="ql8-uk-qRc">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="increaseColumn:" target="-1" id="4Sw-UR-VwZ"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="vXn-Fa-KDE"/>
Expand Down
6 changes: 6 additions & 0 deletions Interfaces/iTermEditKeyActionWindowController.xib
Expand Up @@ -114,6 +114,12 @@
<menuItem title="Increase Row" tag="50" id="76W-hp-334">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Decrease Column" tag="51" id="TdK-gh-sNx">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Increase Column" tag="52" id="mHj-xJ-MJH">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="xVG-IF-xul"/>
<menuItem title="Scroll to End" tag="4" id="Mrs-CO-Zqo"/>
<menuItem title="Scroll to Top" tag="5" id="Gnz-HA-ehs"/>
Expand Down
10 changes: 9 additions & 1 deletion sources/PTYSession.m
Expand Up @@ -4814,7 +4814,15 @@ - (void)keyDown:(NSEvent *)event {
case KEY_ACTION_INCREASE_ROW:
[[[iTermController sharedInstance] currentTerminal] increaseRow:nil];
break;


case KEY_ACTION_DECREASE_COLUMN:
[[[iTermController sharedInstance] currentTerminal] decreaseColumn:nil];
break;

case KEY_ACTION_INCREASE_COLUMN:
[[[iTermController sharedInstance] currentTerminal] increaseColumn:nil];
break;

default:
NSLog(@"Unknown key action %d", keyBindingAction);
break;
Expand Down
10 changes: 10 additions & 0 deletions sources/PseudoTerminal.m
Expand Up @@ -5647,6 +5647,16 @@ - (IBAction)decreaseRow:(id)sender {
andColumns:self.currentSession.columns];
}

- (IBAction)increaseColumn:(id)sender {
[self.currentSession.screen terminalSetRows:self.currentSession.rows
andColumns:self.currentSession.columns + 1];
}

- (IBAction)decreaseColumn:(id)sender {
[self.currentSession.screen terminalSetRows:self.currentSession.rows
andColumns:self.currentSession.columns - 1];
}

- (void)refreshTmuxLayoutsAndWindow
{
for (PTYTab *aTab in [self tabs]) {
Expand Down
4 changes: 3 additions & 1 deletion sources/WindowControllerInterface.h
Expand Up @@ -176,9 +176,11 @@ typedef NS_ENUM(NSInteger, BroadcastMode) {
- (void)moveTabLeft:(id)sender;
- (void)moveTabRight:(id)sender;

// Expand and shrink window rows.
// Increase and Decrease
- (void)increaseRow:(id)sender;
- (void)decreaseRow:(id)sender;
- (void)increaseColumn:(id)sender;
- (void)decreaseColumn:(id)sender;

// If soft is true, don't kill tmux session. Otherwise is just like closeTab.
- (void)closeTab:(PTYTab *)aTab soft:(BOOL)soft;
Expand Down
3 changes: 3 additions & 0 deletions sources/iTermKeyBindingMgr.h
Expand Up @@ -133,6 +133,9 @@
#define KEY_ACTION_MOVE_START_OF_SELECTION_RIGHT 48
#define KEY_ACTION_DECREASE_ROW 49
#define KEY_ACTION_INCREASE_ROW 50
#define KEY_ACTION_DECREASE_COLUMN 51
#define KEY_ACTION_INCREASE_COLUMN 52


@interface iTermKeyBindingMgr : NSObject {
}
Expand Down
12 changes: 10 additions & 2 deletions sources/iTermKeyBindingMgr.m
Expand Up @@ -472,13 +472,21 @@ + (NSString *)formatAction:(NSDictionary *)keyInfo
break;

case KEY_ACTION_DECREASE_ROW:
actionString = @"Shrink Row";
actionString = @"Decrease Row";
break;

case KEY_ACTION_INCREASE_ROW:
actionString = @"Expand Row";
actionString = @"Increase Row";
break;

case KEY_ACTION_DECREASE_COLUMN:
actionString = @"Decrease Column";
break;

case KEY_ACTION_INCREASE_COLUMN:
actionString = @"Increase Column";
break;

default:
actionString = [NSString stringWithFormat: @"%@ %d", @"Unknown Action ID", action];
break;
Expand Down

0 comments on commit 47041ce

Please sign in to comment.