Skip to content

Commit

Permalink
fix: don't show error when opening missing files
Browse files Browse the repository at this point in the history
closes #130
  • Loading branch information
senyai committed May 26, 2023
1 parent 2b57064 commit 121ec57
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/contentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Event,
EventEmitter,
window,
TextDocumentContentProvider,
} from 'vscode';
import { debounce, throttle } from './decorators';
import { Model, OriginalResourceChangeEvent } from './model';
Expand All @@ -29,7 +30,7 @@ interface Cache {
const THREE_MINUTES = 1000 * 60 * 3;
const FIVE_MINUTES = 1000 * 60 * 5;

export class FossilContentProvider {
export class FossilContentProvider implements TextDocumentContentProvider {
private _onDidChange = new EventEmitter<Uri>();
get onDidChange(): Event<Uri> {
return this._onDidChange.event;
Expand Down Expand Up @@ -101,7 +102,7 @@ export class FossilContentProvider {
async provideTextDocumentContent(uri: Uri): Promise<string> {
const repository = this.model.getRepository(uri);

if (!repository) {
if (!repository || uri.query == 'empty') {
return '';
}

Expand Down

0 comments on commit 121ec57

Please sign in to comment.