Skip to content
Permalink
Browse files

check ignored status in CLM for "editing ignored files" notification

  • Loading branch information...
dmitry-zhuravlev committed Aug 22, 2019
1 parent 6fc1461 commit 3a1251e8fcd652b79c18b30fd2838d171c55c775
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/mobi/hsz/idea/gitignore/daemon/IgnoredEditingNotificationProvider.java
@@ -27,6 +27,7 @@
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.ui.EditorNotificationPanel;
import com.intellij.ui.EditorNotifications;
@@ -65,17 +66,20 @@
@NotNull
private final IgnoreManager manager;

@NotNull
private final ChangeListManager changeListManager;

/**
* Builds a new instance of {@link IgnoredEditingNotificationProvider}.
*
* @param project current project
* @param notifications notifications component
*/
public IgnoredEditingNotificationProvider(@NotNull Project project, @NotNull EditorNotifications notifications) {
public IgnoredEditingNotificationProvider(@NotNull Project project) {
this.project = project;
this.notifications = notifications;
this.notifications = EditorNotifications.getInstance(project);
this.settings = IgnoreSettings.getInstance();
this.manager = IgnoreManager.getInstance(project);
this.changeListManager = ChangeListManager.getInstance(project);
}

/**
@@ -100,8 +104,8 @@ public IgnoredEditingNotificationProvider(@NotNull Project project, @NotNull Edi
@Override
public EditorNotificationPanel createNotificationPanel(@NotNull final VirtualFile file,
@NotNull FileEditor fileEditor, @NotNull Project project) {
if (!settings.isNotifyIgnoredEditing() || !manager.isFileIgnored(file) ||
Properties.isDismissedIgnoredEditingNotification(project, file)) {
if (!settings.isNotifyIgnoredEditing() || Properties.isDismissedIgnoredEditingNotification(project, file)
|| !changeListManager.isIgnoredFile(file) && !manager.isFileIgnored(file)) {
return null;
}

0 comments on commit 3a1251e

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