mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
@@ -2212,3 +2212,8 @@ describe "Editor", ->
|
||||
edited = editor.replaceSelectedText(replacer)
|
||||
expect(replaced).toBe true
|
||||
expect(edited).toBe false
|
||||
|
||||
describe "when editor:copy-path is triggered", ->
|
||||
it "copies the absolute path to the editor's file to the pasteboard", ->
|
||||
editor.trigger 'editor:copy-path'
|
||||
expect(pasteboard.read()[0]).toBe editor.getPath()
|
||||
|
||||
@@ -182,6 +182,7 @@ class Editor extends View
|
||||
'editor:close-other-edit-sessions': @destroyInactiveEditSessions
|
||||
'editor:close-all-edit-sessions': @destroyAllEditSessions
|
||||
'editor:select-grammar': @selectGrammar
|
||||
'editor:copy-path': @copyPathToPasteboard
|
||||
|
||||
documentation = {}
|
||||
for name, method of editorBindings
|
||||
@@ -1154,3 +1155,7 @@ class Editor extends View
|
||||
|
||||
@insertText(text, select: true)
|
||||
true
|
||||
|
||||
copyPathToPasteboard: ->
|
||||
path = @getPath()
|
||||
pasteboard.write(path) if path?
|
||||
|
||||
@@ -37,3 +37,4 @@
|
||||
'alt-meta-w': 'editor:close-other-edit-sessions'
|
||||
'meta-P': 'editor:close-all-edit-sessions'
|
||||
'meta-L': 'editor:select-grammar'
|
||||
'ctrl-C': 'editor:copy-path'
|
||||
|
||||
Reference in New Issue
Block a user