Merge pull request #10359 from ypresto/copy-project-path

Add copy project path command to text-editor
This commit is contained in:
Josh Abernathy
2016-01-12 11:15:09 -05:00
2 changed files with 4 additions and 2 deletions

View File

@@ -169,7 +169,8 @@ module.exports = ({commandRegistry, commandInstaller, config}) ->
'editor:fold-at-indent-level-8': -> @foldAllAtIndentLevel(7)
'editor:fold-at-indent-level-9': -> @foldAllAtIndentLevel(8)
'editor:log-cursor-scope': -> @logCursorScope()
'editor:copy-path': -> @copyPathToClipboard()
'editor:copy-path': -> @copyPathToClipboard(false)
'editor:copy-project-path': -> @copyPathToClipboard(true)
'editor:toggle-indent-guide': -> config.set('editor.showIndentGuide', not config.get('editor.showIndentGuide'))
'editor:toggle-line-numbers': -> config.set('editor.showLineNumbers', not config.get('editor.showLineNumbers'))
'editor:scroll-to-cursor': -> @scrollToCursorPosition()

View File

@@ -666,8 +666,9 @@ class TextEditor extends Model
isPending: -> Boolean(@pending)
# Copies the current file path to the native clipboard.
copyPathToClipboard: ->
copyPathToClipboard: (relative = false) ->
if filePath = @getPath()
filePath = atom.project.relativize(filePath) if relative
@clipboard.write(filePath)
###