@@ -2823,8 +2823,8 @@ class GitGraphView {
28232823 } ) ;
28242824 } ;
28252825
2826- const triggerCopyFilePath = ( file : GG . GitFileChange ) => {
2827- sendMessage ( { command : 'copyFilePath' , repo : this . currentRepo , filePath : file . newFilePath } ) ;
2826+ const triggerCopyFilePath = ( file : GG . GitFileChange , absolute : boolean ) => {
2827+ sendMessage ( { command : 'copyFilePath' , repo : this . currentRepo , filePath : file . newFilePath , absolute : absolute } ) ;
28282828 } ;
28292829
28302830 const triggerViewFileAtRevision = ( file : GG . GitFileChange , fileElem : HTMLElement ) => {
@@ -2884,7 +2884,7 @@ class GitGraphView {
28842884 if ( expandedCommit === null || expandedCommit . fileChanges === null || e . target === null ) return ;
28852885
28862886 const fileElem = getFileElemOfEventTarget ( e . target ) ;
2887- triggerCopyFilePath ( getFileOfFileElem ( expandedCommit . fileChanges , fileElem ) ) ;
2887+ triggerCopyFilePath ( getFileOfFileElem ( expandedCommit . fileChanges , fileElem ) , true ) ;
28882888 } ) ;
28892889
28902890 addListenerToClass ( 'viewGitFileAtRevision' , 'click' , ( e ) => {
@@ -2943,9 +2943,14 @@ class GitGraphView {
29432943 ] ,
29442944 [
29452945 {
2946- title : 'Copy File Path to the Clipboard' ,
2946+ title : 'Copy Absolute File Path to Clipboard' ,
29472947 visible : true ,
2948- onClick : ( ) => triggerCopyFilePath ( file )
2948+ onClick : ( ) => triggerCopyFilePath ( file , true )
2949+ } ,
2950+ {
2951+ title : 'Copy Relative File Path to Clipboard' ,
2952+ visible : true ,
2953+ onClick : ( ) => triggerCopyFilePath ( file , false )
29492954 }
29502955 ]
29512956 ] , false , target , < MouseEvent > e , this . isCdvDocked ( ) ? document . body : this . viewElem , ( ) => {
@@ -3084,7 +3089,7 @@ window.addEventListener('load', () => {
30843089 }
30853090 break ;
30863091 case 'copyFilePath' :
3087- finishOrDisplayError ( msg . error , 'Unable to Copy File Path to the Clipboard' ) ;
3092+ finishOrDisplayError ( msg . error , 'Unable to Copy File Path to Clipboard' ) ;
30883093 break ;
30893094 case 'copyToClipboard' :
30903095 finishOrDisplayError ( msg . error , 'Unable to Copy ' + msg . type + ' to Clipboard' ) ;
@@ -3377,7 +3382,7 @@ function generateFileTreeLeafHtml(name: string, leaf: FileTreeLeaf, gitFiles: Re
33773382 ( initialState . config . enhancedAccessibility ? '<span class="fileTreeFileType" title="' + changeTypeMessage + '">' + fileTreeFile . type + '</span>' : '' ) +
33783383 ( fileTreeFile . type !== GG . GitFileStatus . Added && fileTreeFile . type !== GG . GitFileStatus . Untracked && fileTreeFile . type !== GG . GitFileStatus . Deleted && textFile ? '<span class="fileTreeFileAddDel">(<span class="fileTreeFileAdd" title="' + fileTreeFile . additions + ' addition' + ( fileTreeFile . additions !== 1 ? 's' : '' ) + '">+' + fileTreeFile . additions + '</span>|<span class="fileTreeFileDel" title="' + fileTreeFile . deletions + ' deletion' + ( fileTreeFile . deletions !== 1 ? 's' : '' ) + '">-' + fileTreeFile . deletions + '</span>)</span>' : '' ) +
33793384 ( fileTreeFile . newFilePath === lastViewedFile ? '<span id="cdvLastFileViewed" title="Last File Viewed">' + SVG_ICONS . eyeOpen + '</span>' : '' ) +
3380- '<span class="copyGitFile fileTreeFileAction" title="Copy File Path to the Clipboard">' + SVG_ICONS . copy + '</span>' +
3385+ '<span class="copyGitFile fileTreeFileAction" title="Copy Absolute File Path to Clipboard">' + SVG_ICONS . copy + '</span>' +
33813386 ( fileTreeFile . type !== GG . GitFileStatus . Deleted
33823387 ? ( diffPossible && ! isUncommitted ? '<span class="viewGitFileAtRevision fileTreeFileAction" title="View File at this Revision">' + SVG_ICONS . commit + '</span>' : '' ) +
33833388 '<span class="openGitFile fileTreeFileAction" title="Open File">' + SVG_ICONS . openFile + '</span>'
0 commit comments