mirror of
https://github.com/atom/atom.git
synced 2026-02-12 07:35:14 -05:00
Tildify path in title bar
This will use ~/ for the path to the home directory
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
_ = require 'underscore-plus'
|
||||
path = require 'path'
|
||||
fs = require 'fs-plus'
|
||||
Grim = require 'grim'
|
||||
{CompositeDisposable, Emitter} = require 'event-kit'
|
||||
{Point, Range} = TextBuffer = require 'text-buffer'
|
||||
@@ -803,12 +804,13 @@ class TextEditor extends Model
|
||||
allPathSegments = []
|
||||
for textEditor in atom.workspace.getTextEditors() when textEditor isnt this
|
||||
if textEditor.getFileName() is fileName
|
||||
allPathSegments.push(textEditor.getDirectoryPath().split(path.sep))
|
||||
directoryPath = fs.tildify(textEditor.getDirectoryPath())
|
||||
allPathSegments.push(directoryPath.split(path.sep))
|
||||
|
||||
if allPathSegments.length is 0
|
||||
return fileName
|
||||
|
||||
ourPathSegments = @getDirectoryPath().split(path.sep)
|
||||
ourPathSegments = fs.tildify(@getDirectoryPath()).split(path.sep)
|
||||
allPathSegments.push ourPathSegments
|
||||
|
||||
loop
|
||||
|
||||
Reference in New Issue
Block a user