Moved check for extension deeper and changed order of buildOutline (as well as markers) to happen after currentFile is switched