Skip to content

Commit

Permalink
bugfix: 剪贴板空判断
Browse files Browse the repository at this point in the history
  • Loading branch information
intellism committed Jan 27, 2022
1 parent 4a90709 commit b1595fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/src/command/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { lastHover } from "../languageFeature/hover";

export async function clipboard() {
let text = await env.clipboard.readText();
if(!text) {
outputChannel.appendLine('clipboard:The clipboard is empty');
return;
}
const targetLanguage = getConfig<string>('targetLanguage') || userLanguage;
let translatedText = await translateManager.translate(text, {to:targetLanguage});
outputChannel.appendLine('clipboard:' + translatedText);
Expand Down

0 comments on commit b1595fe

Please sign in to comment.