Simplified method to check active file

Updated the "detectActiveFile" method to be more simple and straightforward.

Thanks to @lodenrogue suggestion!
This commit is contained in:
BattleBas
2017-10-17 22:23:52 -05:00
parent 6c40a968f4
commit 170161d67f

View File

@@ -811,14 +811,8 @@ export class Repository implements Disposable {
this._onDidChangeStatus.fire();
}
private detectActiveFile(fullFilePath: string): boolean {
if (window.activeTextEditor !== undefined) {
if (window.activeTextEditor.document.fileName === fullFilePath) {
return true;
}
}
return false;
private detectActiveFile(fullFilePath: string): boolean | undefined {
return window.activeTextEditor && window.activeTextEditor.document.fileName === fullFilePath;
}
private onFSChange(uri: Uri): void {