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:
commit
dd8b44c711
@ -730,5 +730,6 @@
|
||||
"date-fns": "^2.16.1",
|
||||
"jsonc-parser": "^3.0.0",
|
||||
"which": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"extensionDependencies": ["vscode.git"]
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user