We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0764b09 commit 8e260e2Copy full SHA for 8e260e2
1 file changed
src/util/commands/addComment.ts
@@ -7,14 +7,15 @@
7
8
import { Range, window } from 'vscode';
9
import { constants, GCommands } from '../constants';
10
+import { Messages } from '../messages';
11
import { GCommand } from './base';
12
13
export class AddComment extends GCommand {
14
constructor() {
15
super(GCommands.AddComment);
16
}
17
- execute() {
18
+ async execute() {
19
const editor = window.activeTextEditor;
20
let replace = '';
21
@@ -34,9 +35,11 @@ export class AddComment extends GCommand {
34
35
replace += `(${lines[i]})${i + 1 === lines.length ? '' : '\n'}`;
36
37
- void editor.edit(editBuilder => {
38
+ await editor.edit(editBuilder => {
39
editBuilder.replace(select, replace);
40
});
41
+ } else {
42
+ await Messages.showErrorMessage('Editor does not contain G-Code');
43
44
45
0 commit comments