Skip to content

Commit

Permalink
Merge pull request #57 from vallentin/patch-1
Browse files Browse the repository at this point in the history
Rephrased various log messages
  • Loading branch information
mushanshitiancai authored Feb 2, 2020
2 parents ddb0a5d + 3db14c6 commit fb79532
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Paster {
let fileUri = editor.document.uri;
if (!fileUri) return;
if (fileUri.scheme === 'untitled') {
Logger.showInformationMessage('Before paste image, you need to save current edit file first.');
Logger.showInformationMessage('Before pasting the image, you need to save current file first.');
return;
}
let filePath = fileUri.fsPath;
Expand All @@ -96,7 +96,7 @@ class Paster {
var selection = editor.selection;
var selectText = editor.document.getText(selection);
if (selectText && /[\\:*?<>|]/.test(selectText)) {
Logger.showInformationMessage('Your selection is not a valid file name!');
Logger.showInformationMessage('Your selection is not a valid filename!');
return;
}

Expand Down Expand Up @@ -172,7 +172,7 @@ class Paster {
this.saveClipboardImageToFileAndGetPath(imagePath, (imagePath, imagePathReturnByScript) => {
if (!imagePathReturnByScript) return;
if (imagePathReturnByScript === 'no image') {
Logger.showInformationMessage('There is not a image in clipboard.');
Logger.showInformationMessage('There is not an image in the clipboard.');
return;
}

Expand Down Expand Up @@ -265,7 +265,7 @@ class Paster {
if (stats.isDirectory()) {
resolve(imagePath);
} else {
reject(new PluginError(`The image dest directory '${imageDir}' is a file. please check your 'pasteImage.path' config.`))
reject(new PluginError(`The image dest directory '${imageDir}' is a file. Please check your 'pasteImage.path' config.`))
}
} else if (err.code == "ENOENT") {
fse.ensureDir(imageDir, (err) => {
Expand Down Expand Up @@ -311,7 +311,7 @@ class Paster {
]);
powershell.on('error', function (e) {
if (e.code == "ENOENT") {
Logger.showErrorMessage(`The powershell command is not in you PATH environment variables.Please add it and retry.`);
Logger.showErrorMessage(`The powershell command is not in you PATH environment variables. Please add it and retry.`);
} else {
Logger.showErrorMessage(e);
}
Expand Down Expand Up @@ -428,4 +428,4 @@ class Paster {
class PluginError {
constructor(public message?: string) {
}
}
}

0 comments on commit fb79532

Please sign in to comment.