@@ -789,20 +789,14 @@ define(function (require, exports, module) {
789789 let fileChangeListenerStartDelay = 0 ;
790790 if ( Phoenix . isNativeApp && Phoenix . platform === "mac" ) {
791791 // in mac, if we do the `open with Phoenix Code` from finder, then, the open with events come as events
792- // after app start. This causes a problem where if we opens a txt file with open with, and and html file was
792+ // after app start. This causes a problem where if we open a txt file with open with, and an html file was
793793 // open previously, then currentFileChange listener will see the html file at first and open the live
794794 // preview panel, and immediately, the txt file event will be sent by os resulting in a no preview page.
795795 // we should not show a no preview page for opening txt / non-previewable files. So, we dont attach the
796- // change listener in macos for a few seconds, and attach the listener if the user explicitly clicks on a
797- // file.
798- fileChangeListenerStartDelay = 500 ;
799- ProjectManager . on ( ProjectManager . EVENT_FILE_CLICKED_SIDEBAR , ( ) => {
800- MainViewManager . off ( "currentFileChange" , _currentFileChanged ) ;
801- MainViewManager . on ( "currentFileChange" , _currentFileChanged ) ;
802- } ) ;
796+ // change listener in macos for a second to give some time for the os event to reach.
797+ fileChangeListenerStartDelay = 600 ;
803798 }
804799 setTimeout ( ( ) => {
805- MainViewManager . off ( "currentFileChange" , _currentFileChanged ) ;
806800 MainViewManager . on ( "currentFileChange" , _currentFileChanged ) ;
807801 if ( Phoenix . isNativeApp && Phoenix . platform === "mac" && MainViewManager . getCurrentlyViewedFile ( ) ) {
808802 _currentFileChanged ( null , MainViewManager . getCurrentlyViewedFile ( ) ) ;
0 commit comments