From 569ab416b84bb78808f81d1d7ec0bbb826127fa7 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 3 Feb 2014 13:12:33 -0800 Subject: [PATCH] Replace pasteboard references with clipboard --- spec/editor-spec.coffee | 4 ++-- spec/editor-view-spec.coffee | 2 +- spec/pasteboard-spec.coffee | 8 ++++---- spec/spec-helper.coffee | 6 +++--- src/editor.coffee | 18 +++++++++--------- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/spec/editor-spec.coffee b/spec/editor-spec.coffee index 741ea3b4c..38a29f6fb 100644 --- a/spec/editor-spec.coffee +++ b/spec/editor-spec.coffee @@ -1856,12 +1856,12 @@ describe "Editor", -> expect(editor.getCursorBufferPosition()).toEqual [0, 2] expect(editor.getCursorScreenPosition()).toEqual [0, editor.getTabLength() * 2] - describe "pasteboard operations", -> + describe "clipboard operations", -> beforeEach -> editor.setSelectedBufferRanges([[[0, 4], [0, 13]], [[1, 6], [1, 10]]]) describe ".cutSelectedText()", -> - it "removes the selected text from the buffer and places it on the pasteboard", -> + it "removes the selected text from the buffer and places it on the clipboard", -> editor.cutSelectedText() expect(buffer.lineForRow(0)).toBe "var = function () {" expect(buffer.lineForRow(1)).toBe " var = function(items) {" diff --git a/spec/editor-view-spec.coffee b/spec/editor-view-spec.coffee index 54d435185..b84867374 100644 --- a/spec/editor-view-spec.coffee +++ b/spec/editor-view-spec.coffee @@ -2515,7 +2515,7 @@ describe "EditorView", -> expect(edited).toBe false describe "when editor:copy-path is triggered", -> - it "copies the absolute path to the editor view's file to the pasteboard", -> + it "copies the absolute path to the editor view's file to the clipboard", -> editorView.trigger 'editor:copy-path' expect(atom.clipboard.read().text).toBe editor.getPath() diff --git a/spec/pasteboard-spec.coffee b/spec/pasteboard-spec.coffee index 5e8dddfde..eaf4c7eb1 100644 --- a/spec/pasteboard-spec.coffee +++ b/spec/pasteboard-spec.coffee @@ -1,11 +1,11 @@ -describe "Pasteboard", -> +describe "Clipboard", -> describe "write(text, metadata) and read()", -> - it "writes and reads text to/from the native pasteboard", -> - expect(atom.clipboard.read().text).toBe 'initial pasteboard content' + it "writes and reads text to/from the native clipboard", -> + expect(atom.clipboard.read().text).toBe 'initial clipboard content' atom.clipboard.write('next') expect(atom.clipboard.read().text).toBe 'next' - it "returns metadata if the item on the native pasteboard matches the last written item", -> + it "returns metadata if the item on the native clipboard matches the last written item", -> atom.clipboard.write('next', {meta: 'data'}) expect(atom.clipboard.read().text).toBe 'next' expect(atom.clipboard.read().metadata).toEqual {meta: 'data'} diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 8e939d03d..c93dcf4fd 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -95,9 +95,9 @@ beforeEach -> TokenizedBuffer.prototype.chunkSize = Infinity spyOn(TokenizedBuffer.prototype, "tokenizeInBackground").andCallFake -> @tokenizeNextChunk() - pasteboardContent = 'initial pasteboard content' - spyOn(clipboard, 'writeText').andCallFake (text) -> pasteboardContent = text - spyOn(clipboard, 'readText').andCallFake -> pasteboardContent + clipboardContent = 'initial clipboard content' + spyOn(clipboard, 'writeText').andCallFake (text) -> clipboardContent = text + spyOn(clipboard, 'readText').andCallFake -> clipboardContent addCustomMatchers(this) diff --git a/src/editor.coffee b/src/editor.coffee index bc422b154..c1cfa1114 100644 --- a/src/editor.coffee +++ b/src/editor.coffee @@ -535,24 +535,24 @@ class Editor extends Model # Public: Copies and removes all characters from cursor to the end of the # line. cutToEndOfLine: -> - maintainPasteboard = false + maintainClipboard = false @mutateSelectedText (selection) -> - selection.cutToEndOfLine(maintainPasteboard) - maintainPasteboard = true + selection.cutToEndOfLine(maintainClipboard) + maintainClipboard = true # Public: Cuts the selected text. cutSelectedText: -> - maintainPasteboard = false + maintainClipboard = false @mutateSelectedText (selection) -> - selection.cut(maintainPasteboard) - maintainPasteboard = true + selection.cut(maintainClipboard) + maintainClipboard = true # Public: Copies the selected text. copySelectedText: -> - maintainPasteboard = false + maintainClipboard = false for selection in @getSelections() - selection.copy(maintainPasteboard) - maintainPasteboard = true + selection.copy(maintainClipboard) + maintainClipboard = true # Public: Pastes the text in the clipboard. #