Browse Source

fixes #4 - upload all content if the editor have no selection

tags/v0.0.4
Andreas 9 months ago
parent
commit
a09cb83f78
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      extension.js
  2. 1
    1
      package.json

+ 1
- 1
extension.js View File

@@ -9,7 +9,7 @@ const crypto = require("crypto");
async function CreatePaste() {
const editor = vscode.window.activeTextEditor;
const settings = vscode.workspace.getConfiguration('npaste');
const text = editor.document.getText(editor.selection).toString();
const text = editor.selection.isEmpty ? editor.document.getText() : editor.document.getText(editor.selection);

console.log(text);


+ 1
- 1
package.json View File

@@ -68,7 +68,7 @@
"command": "extension.npasteUpload",
"key": "ctrl+alt+p",
"mac": "cmd+alt+p",
"when": "editorHasSelection"
"when": "editorTextFocus"
}
]
},

Loading…
Cancel
Save