File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ export function activate(context: vscode.ExtensionContext) {
5656
5757 context . subscriptions . push (
5858 vscode . commands . registerCommand ( "extension.gitextensions.blame" , ( ) => {
59+ if ( window . activeTextEditor === undefined ) {
60+ vscode . window . showWarningMessage ( 'No file selected.' )
61+ return ;
62+ }
5963 const path = window . activeTextEditor . document . uri . fsPath ;
6064 launchGitExtensions ( "blame" , path ) ;
6165 } )
@@ -94,6 +98,7 @@ export function activate(context: vscode.ExtensionContext) {
9498 context . subscriptions . push (
9599 vscode . commands . registerCommand ( "extension.gitextensions.difftool" , ( ) => {
96100 if ( window . activeTextEditor === undefined ) {
101+ vscode . window . showWarningMessage ( 'No file selected.' )
97102 return ;
98103 }
99104 const filePath = window . activeTextEditor . document . uri . fsPath ;
@@ -104,6 +109,7 @@ export function activate(context: vscode.ExtensionContext) {
104109 context . subscriptions . push (
105110 vscode . commands . registerCommand ( "extension.gitextensions.filehistory" , ( ) => {
106111 if ( window . activeTextEditor === undefined ) {
112+ vscode . window . showWarningMessage ( 'No file selected.' )
107113 return ;
108114 }
109115 const filePath = window . activeTextEditor . document . uri . fsPath ;
You can’t perform that action at this time.
0 commit comments