mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Fix initial window placement bug
The algorithm which determines the topmost window only searches through visible windows. The initial window placement bug was a result of this algorithm returning the (invisible) window whose position was to be determined.
This commit is contained in:
@@ -741,9 +741,10 @@ static int executeInLoginShell(NSString *path, NSArray *args);
|
||||
|
||||
- (MMVimController *)topmostVimController
|
||||
{
|
||||
NSArray *windows = [NSApp orderedWindows];
|
||||
if ([windows count] > 0) {
|
||||
NSWindow *window = [windows objectAtIndex:0];
|
||||
// Find the topmost visible window which has an associated vim controller.
|
||||
NSEnumerator *e = [[NSApp orderedWindows] objectEnumerator];
|
||||
id window;
|
||||
while ((window = [e nextObject]) && [window isVisible]) {
|
||||
unsigned i, count = [vimControllers count];
|
||||
for (i = 0; i < count; ++i) {
|
||||
MMVimController *vc = [vimControllers objectAtIndex:i];
|
||||
|
||||
Reference in New Issue
Block a user