@@ -97,8 +97,12 @@ - (void)activate
9797 if (window == nil ) {
9898 [NSBundle loadNibNamed: @" Launcher" owner: self ];
9999 } else {
100+ NSString *fieldValue = [commandField stringValue ];
100101 [completionList reloadColumn: 0 ];
101- // [completionList setTitle:@"History" ofColumn:0];
102+ [completionList setTitle: @" History" ofColumn: 0 ];
103+ if (fieldValue.length > 0 ) {
104+ [completionList selectRow: [historyList indexOfObject: fieldValue] inColumn: 0 ];
105+ }
102106 }
103107
104108 [commandField selectText: nil ];
@@ -158,9 +162,13 @@ - (void)runCommand:(id)sender
158162 } @catch (NSException *exception) {
159163 NXTRunAlertPanel (@" Run Command" , @" Run command failed with exception: \' %@ \' " , @" Close" , nil ,
160164 nil , [exception reason ]);
161- } @finally {
162- [window close ] ;
165+ [window makeKeyAndOrderFront: self ];
166+ return ;
163167 }
168+ // @finally {
169+ // [window close];
170+ // }
171+ [window close ];
164172}
165173
166174- (void )runInTerminal : (id )sender
@@ -445,6 +453,7 @@ - (void)listItemClicked:(id)sender
445453{
446454 NSInteger selRow;
447455 NSString *absPath;
456+ NSString *fieldValue = [commandField stringValue ];
448457 id object;
449458
450459 if (sender != completionList)
@@ -455,7 +464,7 @@ - (void)listItemClicked:(id)sender
455464 if (absPath == nil ) {
456465 absPath = [completionSource objectAtIndex: completionIndex];
457466 }
458- if ([[commandField stringValue ] characterAtIndex: 0 ] == ' ~' ) {
467+ if (fieldValue && fieldValue. length > 0 && [fieldValue characterAtIndex: 0 ] == ' ~' ) {
459468 absPath = [absPath stringByAbbreviatingWithTildeInPath ];
460469 }
461470
0 commit comments