Skip to content

Commit

Permalink
Updated node-copy-paste to 0.3
Browse files Browse the repository at this point in the history
Updated cursor position at end of paste.
  • Loading branch information
jbardnz committed Aug 5, 2014
1 parent 1b50dd0 commit 2fd1c63
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 26 deletions.
8 changes: 5 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,24 @@ define(function (require, exports, module) {
chain(connect, loadClipboard, clipboardLoad);
});





$(nodeConnection).on("clipboard.paste", function (e, clipboardContent) {
var thisEditor = EditorManager.getCurrentFullEditor();
var cp = thisEditor._codeMirror.getCursor();
thisEditor._codeMirror.replaceSelection(clipboardContent.content);

//move cursor to end of pasted content
cp.ch += clipboardContent.content.length;
thisEditor._codeMirror.setCursor(cp);
});


//Function to run when the menu item is clicked
function handleRightClickPaste() {

//Paste text
nodeConnection.domains.clipboard.callPaste();

}

function handleRightClickCopy() {
Expand Down
4 changes: 2 additions & 2 deletions node/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
var domainManager;

function load(){

}


function bracketPaste() {

node_copy_paste.paste(function(e, content){

domainManager.emitEvent('clipboard', 'paste', {'content':content});
});

Expand All @@ -20,7 +21,6 @@
function bracketCopy(userSelection) {

node_copy_paste.copy(userSelection);

}


Expand Down
5 changes: 3 additions & 2 deletions node/node_modules/copy-paste/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 44 additions & 15 deletions node/node_modules/copy-paste/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/node_modules/copy-paste/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node/node_modules/copy-paste/platform/openbsd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions node/node_modules/copy-paste/platform/win32.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "Right Click Extended",
"description": "Adds Cut, Copy and Paste options to the right click menu",
"homepage": "https://github.com/jbardnz/RightClickExtended",
"version": "1.1.2",
"version": "1.2.0",
"author": "Jarrad Salmon <[email protected]>",
"license": "MIT",
"engines": {
Expand Down

0 comments on commit 2fd1c63

Please sign in to comment.