mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Add copy project path command to text-editor
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
###
|
||||
|
||||
Reference in New Issue
Block a user