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

Fix an off-by-one bug where we don't zoom on the last selected line. Issue 6321

parent 78a9f0dc
No related branches found
No related tags found
No related merge requests found
Loading
@@ -8464,6 +8464,7 @@ ITERM_WEAKLY_REFERENCEABLE
Loading
@@ -8464,6 +8464,7 @@ ITERM_WEAKLY_REFERENCEABLE
   
- (NSString *)currentLocalWorkingDirectory { - (NSString *)currentLocalWorkingDirectory {
if (_lastDirectoryIsUnsuitableForOldPWD || _lastDirectory == nil) { if (_lastDirectoryIsUnsuitableForOldPWD || _lastDirectory == nil) {
DLog(@"Last directory is unsuitable or nil");
// Ask the kernel what the child's process's working directory is. // Ask the kernel what the child's process's working directory is.
return [_shell getWorkingDirectory]; return [_shell getWorkingDirectory];
} else { } else {
Loading
@@ -8473,6 +8474,7 @@ ITERM_WEAKLY_REFERENCEABLE
Loading
@@ -8473,6 +8474,7 @@ ITERM_WEAKLY_REFERENCEABLE
// to expand symlinks on _lastDirectory and use it if it matches what the kernel reports. // to expand symlinks on _lastDirectory and use it if it matches what the kernel reports.
// That was a bad idea because expanding symlinks is slow on network file systems (Issue 4901). // That was a bad idea because expanding symlinks is slow on network file systems (Issue 4901).
// Instead, we'll use _lastDirectory if we believe it's on localhost. // Instead, we'll use _lastDirectory if we believe it's on localhost.
DLog(@"Using last directory from shell integration: %@", _lastDirectory);
return _lastDirectory; return _lastDirectory;
} }
} }
Loading
Loading
Loading
@@ -5063,7 +5063,7 @@ ITERM_WEAKLY_REFERENCEABLE
Loading
@@ -5063,7 +5063,7 @@ ITERM_WEAKLY_REFERENCEABLE
iTermSubSelection *sub = [selection.allSubSelections lastObject]; iTermSubSelection *sub = [selection.allSubSelections lastObject];
if (sub) { if (sub) {
[self showRangeOfLines:NSMakeRange(sub.range.coordRange.start.y, [self showRangeOfLines:NSMakeRange(sub.range.coordRange.start.y,
sub.range.coordRange.end.y - sub.range.coordRange.start.y) sub.range.coordRange.end.y - sub.range.coordRange.start.y + 1)
inSession:session]; inSession:session];
} }
} }
Loading
@@ -7594,6 +7594,7 @@ ITERM_WEAKLY_REFERENCEABLE
Loading
@@ -7594,6 +7594,7 @@ ITERM_WEAKLY_REFERENCEABLE
currentSession = currentSession.tmuxGatewaySession; currentSession = currentSession.tmuxGatewaySession;
} }
if (currentSession) { if (currentSession) {
DLog(@"Getting current local working directory");
previousDirectory = [currentSession currentLocalWorkingDirectory]; previousDirectory = [currentSession currentLocalWorkingDirectory];
} }
   
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