Browse Source

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

tags/v0.0.4
Andreas 6 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");
9 9
 async function CreatePaste() {
10 10
 	const editor = vscode.window.activeTextEditor;
11 11
 	const settings = vscode.workspace.getConfiguration('npaste');
12
-	const text = editor.document.getText(editor.selection).toString();
12
+	const text = editor.selection.isEmpty ? editor.document.getText() : editor.document.getText(editor.selection);
13 13
 
14 14
 	console.log(text);
15 15
 

+ 1
- 1
package.json View File

@@ -68,7 +68,7 @@
68 68
 				"command": "extension.npasteUpload",
69 69
 				"key": "ctrl+alt+p",
70 70
 				"mac": "cmd+alt+p",
71
-				"when": "editorHasSelection"
71
+				"when": "editorTextFocus"
72 72
 			}
73 73
 		]
74 74
 	},

Loading…
Cancel
Save