Skip to content

Commit 4374735

Browse files
authored
Merge pull request #439 from zebHub/master
Three window level actions
2 parents 8133aa2 + 1e3514c commit 4374735

4 files changed

Lines changed: 36 additions & 0 deletions

File tree

runtime/menu.vim

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ if has("gui_macvim")
8080
an <silent> 9998.350 Window.Select\ Previous\ Tab :tabprevious<CR>
8181
an 9998.360 Window.-SEP2- <Nop>
8282
an <silent> 9998.370 Window.Bring\ All\ To\ Front <Nop>
83+
an <silent> 9998.380 Window.Stay\ in\ Front <Nop>
84+
an <silent> 9998.390 Window.Stay\ in\ Back <Nop>
85+
an <silent> 9998.400 Window.Stay\ Level\ Normal <Nop>
8386
endif
8487

8588
" Help menu
@@ -1255,6 +1258,9 @@ if has("gui_macvim")
12551258
macm Window.Select\ Next\ Tab key=<D-}>
12561259
macm Window.Select\ Previous\ Tab key=<D-{>
12571260
macm Window.Bring\ All\ To\ Front action=arrangeInFront:
1261+
macm Window.Stay\ in\ Front action=stayInFront:
1262+
macm Window.Stay\ in\ Back action=stayInBack:
1263+
macm Window.Stay\ Level\ Normal action=stayLevelNormal:
12581264

12591265
macm Help.MacVim\ Help key=<D-?>
12601266
macm Help.MacVim\ Website action=openWebsite:

src/MacVim/Actions.plist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,11 @@
7272
<string></string>
7373
<key>zoomAll:</key>
7474
<string></string>
75+
<key>stayInFront:</key>
76+
<string></string>
77+
<key>stayInBack:</key>
78+
<string></string>
79+
<key>stayLevelNormal:</key>
80+
<string></string>
7581
</dict>
7682
</plist>

src/MacVim/MMAppController.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,8 @@
5353
- (IBAction)openWebsite:(id)sender;
5454
- (IBAction)showVimHelp:(id)sender;
5555
- (IBAction)zoomAll:(id)sender;
56+
- (IBAction)stayInFront:(id)sender;
57+
- (IBAction)stayInBack:(id)sender;
58+
- (IBAction)stayLevelNormal:(id)sender;
5659

5760
@end

src/MacVim/MMAppController.m

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,27 @@ - (IBAction)zoomAll:(id)sender
11961196
[NSApp makeWindowsPerform:@selector(performZoom:) inOrder:YES];
11971197
}
11981198

1199+
- (IBAction)stayInFront:(id)sender
1200+
{
1201+
ASLogDebug(@"Stay in Front");
1202+
NSWindow *keyWindow = [NSApp keyWindow];
1203+
[keyWindow setLevel:NSFloatingWindowLevel];
1204+
}
1205+
1206+
- (IBAction)stayInBack:(id)sender
1207+
{
1208+
ASLogDebug(@"Stay in Back");
1209+
NSWindow *keyWindow = [NSApp keyWindow];
1210+
[keyWindow setLevel:kCGDesktopIconWindowLevel +1];
1211+
}
1212+
1213+
- (IBAction)stayLevelNormal:(id)sender
1214+
{
1215+
ASLogDebug(@"Stay level normal");
1216+
NSWindow *keyWindow = [NSApp keyWindow];
1217+
[keyWindow setLevel:NSNormalWindowLevel];
1218+
}
1219+
11991220
- (IBAction)coreTextButtonClicked:(id)sender
12001221
{
12011222
ASLogDebug(@"Toggle CoreText renderer");

0 commit comments

Comments
 (0)