Skip to content

Commit 04561d6

Browse files
authored
Merge pull request #404 from itaiferber/master
Report focus change on window key (not main)
2 parents 59f5f0a + 2c1841d commit 04561d6

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/MacVim/MMWindowController.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,15 +969,19 @@ - (BOOL)validateMenuItem:(NSMenuItem *)item
969969
- (void)windowDidBecomeMain:(NSNotification *)notification
970970
{
971971
[[MMAppController sharedInstance] setMainMenu:[vimController mainMenu]];
972-
[vimController sendMessage:GotFocusMsgID data:nil];
973972

974973
if ([vimView textView]) {
975974
NSFontManager *fm = [NSFontManager sharedFontManager];
976975
[fm setSelectedFont:[[vimView textView] font] isMultiple:NO];
977976
}
978977
}
979978

980-
- (void)windowDidResignMain:(NSNotification *)notification
979+
- (void)windowDidBecomeKey:(NSNotificationCenter *)notification
980+
{
981+
[vimController sendMessage:GotFocusMsgID data:nil];
982+
}
983+
984+
- (void)windowDidResignKey:(NSNotification *)notification
981985
{
982986
[vimController sendMessage:LostFocusMsgID data:nil];
983987
}

0 commit comments

Comments
 (0)