src/document/DocumentCommandHandlers.js
function handleCurrentFileChange() {
        var newFile = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE);

        if (newFile) {
            var newDocument = DocumentManager.getOpenDocumentForPath(newFile.fullPath);

            if (newDocument) {
                _currentTitlePath = _shortTitleForDocument(newDocument);
            } else {
                _currentTitlePath = ProjectManager.makeProjectRelativeIfPossible(newFile.fullPath);
            }
        } else {
            _currentTitlePath = null;
        }

        // Update title text & "dirty dot" display
        _updateTitle();
    }
function handleCurrentFileChange() {
        var newFile = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE);

        if (newFile) {
            var newDocument = DocumentManager.getOpenDocumentForPath(newFile.fullPath);

            if (newDocument) {
                _currentTitlePath = _shortTitleForDocument(newDocument);
            } else {
                _currentTitlePath = ProjectManager.makeProjectRelativeIfPossible(newFile.fullPath);
            }
        } else {
            _currentTitlePath = null;
        }

        // Update title text & "dirty dot" display
        _updateTitle();
    }
function handleCurrentFileChange ( ) { var newFile = MainViewManager . getCurrentlyViewedFile ( MainViewManager . ACTIVE_PANE ) ; if ( newFile ) { var newDocument = DocumentManager . getOpenDocumentForPath ( newFile . fullPath ) ; if ( newDocument ) { _currentTitlePath = _shortTitleForDocument ( newDocument ) ; } else { _currentTitlePath = ProjectManager . makeProjectRelativeIfPossible ( newFile . fullPath ) ; } } else { _currentTitlePath = null ; } // Update title text & "dirty dot" display _updateTitle ( ) ; }
Handles currentFileChange and filenameChanged events and updates the titlebar
Handles currentFileChange and filenameChanged events and updates the titlebar