Skip to content
Permalink
Browse files

additionally check change list manager "isIgnored" to decide if the f…

…ile being ignored (fix #612)
  • Loading branch information
dmitry-zhuravlev committed Dec 20, 2019
1 parent 15cb3d2 commit 14683788b81c9b20b1852795c77aeed2a1633ea6
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/mobi/hsz/idea/gitignore/actions/CloseIgnoredEditorsAction.java
@@ -31,6 +31,8 @@
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.FileStatusManager;
import com.intellij.openapi.vcs.ProjectLevelVcsManager;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vfs.VirtualFile;
import mobi.hsz.idea.gitignore.IgnoreBundle;
import mobi.hsz.idea.gitignore.vcs.IgnoreFileStatusProvider;

@@ -48,9 +50,13 @@
*/
@Override
protected boolean isFileToClose(final EditorComposite editor, final EditorWindow window) {
final FileStatusManager fileStatusManager = FileStatusManager.getInstance(window.getManager().getProject());
final Project project = window.getManager().getProject();
final FileStatusManager fileStatusManager = FileStatusManager.getInstance(project);
final ChangeListManager changeListManager = ChangeListManager.getInstance(project);
final VirtualFile fileInEditor = editor.getFile();
return fileStatusManager != null &&
fileStatusManager.getStatus(editor.getFile()).equals(IgnoreFileStatusProvider.IGNORED);
fileStatusManager.getStatus(fileInEditor).equals(IgnoreFileStatusProvider.IGNORED) ||
changeListManager.isIgnoredFile(fileInEditor);
}

/**

0 comments on commit 1468378

Please sign in to comment.
You can’t perform that action at this time.