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] = &[
5858
5959const CURSOR_BLINK_INTERVAL : Duration = Duration :: from_millis ( 500 ) ;
6060
61+ const GIT_DIFF_PATH_PREFIXES : & [ char ] = & [ 'a' , 'b' ] ;
62+
6163///Event to transmit the scroll from the element to the view
6264#[ derive( Clone , Debug , PartialEq ) ]
6365pub struct ScrollTerminal ( pub i32 ) ;
@@ -826,6 +828,19 @@ fn possible_open_targets(
826828 {
827829 potential_cwd_and_workspace_paths. insert ( potential_worktree_path) ;
828830 }
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+ }
829844 } ) ;
830845 }
831846
You can’t perform that action at this time.
0 commit comments