File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,8 @@ const REGEX_SPECIAL_CHARS: &[char] = &[
58
58
59
59
const CURSOR_BLINK_INTERVAL : Duration = Duration :: from_millis ( 500 ) ;
60
60
61
+ const GIT_DIFF_PATH_PREFIXES : & [ char ] = & [ 'a' , 'b' ] ;
62
+
61
63
///Event to transmit the scroll from the element to the view
62
64
#[ derive( Clone , Debug , PartialEq ) ]
63
65
pub struct ScrollTerminal ( pub i32 ) ;
@@ -826,6 +828,19 @@ fn possible_open_targets(
826
828
{
827
829
potential_cwd_and_workspace_paths. insert ( potential_worktree_path) ;
828
830
}
831
+
832
+ for prefix in GIT_DIFF_PATH_PREFIXES {
833
+ let prefix_str = & prefix. to_string ( ) ;
834
+ if maybe_path. starts_with ( prefix_str) {
835
+ let stripped = maybe_path. strip_prefix ( prefix_str) . unwrap_or ( & maybe_path) ;
836
+ for potential_worktree_path in workspace
837
+ . worktrees ( cx)
838
+ . map ( |worktree| worktree. read ( cx) . abs_path ( ) . join ( & stripped) )
839
+ {
840
+ potential_cwd_and_workspace_paths. insert ( potential_worktree_path) ;
841
+ }
842
+ }
843
+ }
829
844
} ) ;
830
845
}
831
846
You can’t perform that action at this time.
0 commit comments