     switch type
       when 'code','text','unknown'
         log "open with a text editor"
-        @open @defaultApps.text, (appController)->
-          appController.openFile file
+        @open @defaultApps.text, (appController)-> appController.openFile file
       when 'image'
         log "open with an image processing app"
       when 'video'

      defaultCallback      = -> createOrShow appOptions, callback
      kodingAppsController = @getSingleton("kodingAppsController")

      unless options.thirdParty
        # if there is no registered appController
        # we assume it should be a 3rd party app


        switch appOptions.openWith
          when "lastActive" then do defaultCallback
          when "prompt"
            log "prompting"
            if @appControllers[name]?.instances.length > 1
              log "more than one, namely", @appControllers[name].instances.length
              @createPromptModal appOptions, (appInstanceIndex, openNew)=>
                if typeof appInstanceIndex is "number"
                  appInstance = @appControllers[name].instances[appInstanceIndex]
                  # user selected appInstance to open
                  @show appInstance, callback
                else if openNew
                  # user wants to open a fresh instance
                  @create name, callback
                else
                  warn "user cancelled app to open"
            else do defaultCallback
      else do defaultCallback

  fetchManifests:(callback)->
