Update gitignore decorations when .git/info/exclude file is edited (#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
This commit is contained in:
Vyacheslav Pukhanov 2020-09-09 10:37:56 +03:00 committed by GitHub
parent d2da7e966e
commit 7792c61393
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
));