function go(path, edit, previousSession) {
            edit = edit || editor.getActiveEditor();
            if (!path) {
                return Promise.reject("No path");
            }

            if (api.specialDocs[path]) {
                var session = api.specialDocs[path];
                show(session);
                return Promise.resolve(session);
            }
            var pathParts = path.split(':');
            if (pathParts[0] !== "zed") {
                path = pathParts[0];
                var loc = pathParts[1];
                if (path[0] !== '/') {
                    // Normalize
                    path = '/' + path;
                }
            }

            // See if this session is open in another editor, if so: swap 'em
            // This is to ensure you only have a file open in one editor at a time
            editor.getEditors(true).forEach(function(otherEdit) {
                if(edit === otherEdit) {
                    return;
                }
                if(otherEdit.session.filename === path) {
                    editor.switchSession(edit.session, otherEdit);
                }
            });

            // Check if somebody is not trying to create a file ending with '/'
            if (path[path.length - 1] === '/') {
                eventbus.emit("sessionactivityfailed", previousSession, "Cannot create files ending with /");
                return Promise.reject("Cannot create files ending with /");
            }

            if (sessions[path]) {
                return show(sessions[path]);
            } else if (path.indexOf("zed::") === 0) {
                var readOnly = true;
                if(path.indexOf("|write") !== -1) {
                    path = path.substring(0, path.indexOf("|write"));
                    readOnly = false;
                }
                var session = editor.createSession(path, "");
                session.readOnly = readOnly;
                session.dontPersist = true;
                sessions[path] = session;
                eventbus.emit("newfilecreated", path, session);
                setupSave(session); // Not really saving, but for listening to change events
                return show(session);
            } else {
                eventbus.emit("sessionactivitystarted", previousSession, "Loading...");
                return loadFile(path).then(function(session) {
                    eventbus.emit("sessionactivitycompleted", previousSession);
                    eventbus.emit("newsession", session);
                    return show(session);
                }, function(err) {
                    console.log("Creating new, empty file", path);
                    session = editor.createSession(path, "");
                    setupSave(session);
                    session.newFile = true;
                    return show(session);
                });
            }

            function show(session) {
                session.lastUse = Date.now();
                previousSession = previousSession || edit.getSession();
                if (previousSession.watcherFn) {
                    fs.unwatchFile(previousSession.filename, previousSession.watcherFn);
                }
                editor.switchSession(session, edit);

                if (loc) {
                    setTimeout(function() {
                        locator.jump(loc);
                    });
                }

                // File watching
                if (!session.readOnly && session.filename.indexOf("zed::") !== 0) {
                    session.watcherFn = function(path, kind) {
                        ui.unblockUI();
                        console.log("Got watcher fn", path, kind)
                        if (kind === "changed") {
                            handleChangedFile(path);
                        } else if (kind === "deleted") {
                            var session = sessions[path];
                            if (!session || !session.newFile) {
                                console.log("File deleted", path);
                                delete sessions[path];
                                eventbus.emit("filedeleted", path);
                            }
                        } else {
                            console.log("Other kind", kind);
                            ui.blockUI("Disconnected, hang on... If this message doesn't disappear within a few seconds: close this window and restart your Zed client.");
                        }
                    };
                    fs.watchFile(session.filename, session.watcherFn);
                }

                return Promise.resolve(session);
            }
        }
Navigates to a file, openeing it if hasn't been opened yet, switching to
it if it's already loaded in memory