@@ -37,28 +37,30 @@ public void runActivity(@NotNull Project project) {
3737 public void after (@ NotNull List <? extends VFileEvent > events ) {
3838 // any modification of a file within the project refreshes the preview
3939 Set <String > canonicalPaths = new HashSet <>();
40- for (VFileEvent event : events ) {
41- if (event .getFile () != null ) {
42- if (!project .isDisposed ()) {
43- VirtualFile file = event .getFile ();
44- if (!file .isValid ()) {
45- continue ;
46- }
47- if (!file .getFileType ().equals (AsciiDocFileType .INSTANCE )) {
48- continue ;
49- }
50- if (!DumbService .isDumb (project )) {
51- String canonicalPath = file .getCanonicalPath ();
52- if (canonicalPath != null ) {
53- canonicalPaths .add (canonicalPath );
40+ ApplicationManager .getApplication ().executeOnPooledThread (() -> {
41+ for (VFileEvent event : events ) {
42+ if (event .getFile () != null ) {
43+ if (!project .isDisposed ()) {
44+ VirtualFile file = event .getFile ();
45+ if (!file .isValid ()) {
46+ continue ;
47+ }
48+ if (!file .getFileType ().equals (AsciiDocFileType .INSTANCE )) {
49+ continue ;
50+ }
51+ if (!DumbService .isDumb (project )) {
52+ String canonicalPath = file .getCanonicalPath ();
53+ if (canonicalPath != null ) {
54+ canonicalPaths .add (canonicalPath );
55+ }
5456 }
5557 }
5658 }
5759 }
58- }
59- if (! canonicalPaths . isEmpty ()) {
60- runInBackground ( canonicalPaths , project );
61- }
60+ if (! canonicalPaths . isEmpty ()) {
61+ runInBackground ( canonicalPaths , project );
62+ }
63+ });
6264 }
6365 });
6466 }
0 commit comments