Skip to content
Snippets Groups Projects
Commit d7bc39f8 authored by George Nachman's avatar George Nachman
Browse files

If no pwd is known in trouter, use the current working directory. Handle nil...

If no pwd is known in trouter, use the current working directory. Handle nil working directory better in smart selection code
parent ea2bacaa
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -54,7 +54,7 @@ static NSString* kParameterKey = @"parameter";
title = [title stringByReplacingBackreference:i withString:repl];
}
 
title = [title stringByReplacingEscapedChar:'d' withString:workingDirectory];
title = [title stringByReplacingEscapedChar:'d' withString:workingDirectory ?: @"."];
title = [title stringByReplacingEscapedChar:'h' withString:remoteHost.hostname];
title = [title stringByReplacingEscapedChar:'u' withString:remoteHost.username];
title = [title stringByReplacingEscapedChar:'\\' withString:@"\\"];
Loading
Loading
@@ -96,7 +96,7 @@ static NSString* kParameterKey = @"parameter";
parameter = [parameter stringByReplacingBackreference:i withString:repl];
}
 
parameter = [parameter stringByReplacingEscapedChar:'d' withString:workingDirectory];
parameter = [parameter stringByReplacingEscapedChar:'d' withString:workingDirectory ?: @"."];
parameter = [parameter stringByReplacingEscapedChar:'h' withString:remoteHost.hostname];
parameter = [parameter stringByReplacingEscapedChar:'u' withString:remoteHost.username];
parameter = [parameter stringByReplacingEscapedChar:'n' withString:@"\n"];
Loading
Loading
Loading
Loading
@@ -4391,6 +4391,10 @@ static long long timeInTenthsOfSeconds(struct timeval t)
return [self encoding];
}
 
- (NSString *)textViewCurrentWorkingDirectory {
return [SHELL getWorkingDirectory];
}
- (void)textViewWillNeedUpdateForBlink
{
[self scheduleUpdateIn:[[PreferencePanel sharedInstance] timeBetweenBlinks]];
Loading
Loading
Loading
Loading
@@ -112,7 +112,7 @@ typedef enum {
- (void)textViewBeginDrag;
- (void)textViewMovePane;
- (NSStringEncoding)textViewEncoding;
- (NSString *)textViewCurrentWorkingDirectory;
@end
 
@interface PTYTextView : NSView <
Loading
Loading
Loading
Loading
@@ -9627,6 +9627,13 @@ static double EuclideanDistance(NSPoint p1, NSPoint p2) {
int fileCharsTaken = 0;
 
NSString *workingDirectory = [dataSource workingDirectoryOnLine:y];
if (!workingDirectory) {
// Well, just try the current directory then.
workingDirectory = [_delegate textViewCurrentWorkingDirectory];
}
if (!workingDirectory) {
workingDirectory = @"";
}
// First, try to locate an existing filename at this location.
NSString *filename = [self _bruteforcePathFromBeforeString:[[possibleFilePart1 mutableCopy] autorelease]
afterString:[[possibleFilePart2 mutableCopy] autorelease]
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment