1
1
mirror of https://github.com/kahole/edamagit.git synced 2024-10-26 09:00:54 +03:00

Merge pull request #256 from bjackman/cleanup

A couple of trivial cleanups
This commit is contained in:
Kristian Andersen Hole 2023-05-19 14:06:48 +02:00 committed by GitHub
commit dd8b44c711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View File

@ -730,5 +730,6 @@
"date-fns": "^2.16.1",
"jsonc-parser": "^3.0.0",
"which": "^3.0.0"
}
},
"extensionDependencies": ["vscode.git"]
}

View File

@ -1,12 +1,12 @@
import { Commit, Repository } from '../typings/git';
const commitCache: { [hash: string]: Promise<Commit>; } = {};
const commitCache: { [hash: string]: Promise<Commit> | undefined; } = {};
export function getCommit(repository: Repository, hash: string): Promise<Commit> {
//@ts-expect-error TS2801
if (commitCache[hash]) {
return commitCache[hash];
let cachedResult = commitCache[hash];
if (cachedResult !== undefined) {
return cachedResult;
}
const commitTask = repository.getCommit(hash);

View File

@ -27,13 +27,13 @@ export default class ViewUtils {
}
public static showDocumentColumn(): ViewColumn {
const activeColumn = window.activeTextEditor?.viewColumn ?? 0;
const activeColumn = window.activeTextEditor?.viewColumn;
if (magitConfig.displayBufferSameColumn) {
if (activeColumn && magitConfig.displayBufferSameColumn) {
return activeColumn;
}
if (activeColumn > ViewColumn.One) {
if ((activeColumn ?? 0) > ViewColumn.One) {
return ViewColumn.One;
}
return ViewColumn.Two;