Skip to content

Commit

Permalink
Update gitignore decorations when .git/info/exclude file is edited (#…
Browse files Browse the repository at this point in the history
…106270)

* detect local `exclude` file edits

* use `uri.path` to detect exclude file edits

`uri.path` uses forward slash as a path separator indepentent of
the host system, which makes it easier to use with regex
  • Loading branch information
vpukhanov authored Sep 9, 2020
1 parent d2da7e9 commit 7792c61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extensions/git/src/decorationProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GitIgnoreDecorationProvider implements DecorationProvider {

constructor(private model: Model) {
this.onDidChangeDecorations = fireEvent(anyEvent<any>(
filterEvent(workspace.onDidSaveTextDocument, e => e.fileName.endsWith('.gitignore')),
filterEvent(workspace.onDidSaveTextDocument, e => /\.gitignore$|\.git\/info\/exclude$/.test(e.uri.path)),
model.onDidOpenRepository,
model.onDidCloseRepository
));
Expand Down

0 comments on commit 7792c61

Please sign in to comment.