diff --git a/README.md b/README.md index f1232ae..0873d0a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ The following variables are available: - `projectName` - `filePath` - `fileInProject` +- `fileIsModified` - `relativeFilePath` - `fileName` - `gitHead` diff --git a/lib/custom-title.coffee b/lib/custom-title.coffee index 13db896..330560d 100644 --- a/lib/custom-title.coffee +++ b/lib/custom-title.coffee @@ -47,6 +47,7 @@ module.exports = fileName = item?.getTitle?() ? 'untitled' filePath = item?.getPath?() fileInProject = false + fileIsModified = item?.isModified?() repo = atom.project.getRepositories()[0] gitHead = repo?.getShortHead() @@ -81,7 +82,7 @@ module.exports = projectPath, projectName, fileInProject, filePath, relativeFilePath, fileName, gitHead, gitAdded, gitDeleted - devMode, safeMode + devMode, safeMode, fileIsModified } if filePath or projectPath @@ -97,6 +98,7 @@ module.exports = @subscriptions.add atom.workspace.observeTextEditors (editor) => editorSubscriptions = new CompositeDisposable editorSubscriptions.add editor.onDidSave -> atom.workspace.updateWindowTitle() + editorSubscriptions.add editor.onDidChangeModified -> atom.workspace.updateWindowTitle() editorSubscriptions.add editor.onDidDestroy -> editorSubscriptions.dispose() @subscriptions.add editorSubscriptions