Skip to content

Allow to close files in certain folders #946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Allow to close files in certain folders
  • Loading branch information
msujew committed Apr 6, 2022
commit c59e5e4aead4d0a0417d7f198385d5abff0ad22e
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ export class ApplicationShell extends TheiaApplicationShell {
// Make the editor un-closeable asynchronously.
this.sketchesServiceClient.currentSketch().then((sketch) => {
if (sketch) {
const ignoreFolders = ['.vscode', '.theia', 'src'];
let editorPath = widget.editor.uri;
while (editorPath.toString().length > sketch.uri.length) {
if (ignoreFolders.includes(editorPath.path.base)) {
return;
}
editorPath = editorPath.parent;
}
if (Sketch.isInSketch(widget.editor.uri, sketch)) {
widget.title.closable = false;
}
Expand Down