mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-11 10:19:42 +00:00
Fix paste function in chat box
This commit is contained in:
@@ -206,6 +206,9 @@ class ClaudeChatProvider {
|
||||
case 'updateSettings':
|
||||
this._updateSettings(message.settings);
|
||||
return;
|
||||
case 'getClipboardText':
|
||||
this._getClipboardText();
|
||||
return;
|
||||
}
|
||||
},
|
||||
null,
|
||||
@@ -1146,6 +1149,18 @@ class ClaudeChatProvider {
|
||||
}
|
||||
}
|
||||
|
||||
private async _getClipboardText(): Promise<void> {
|
||||
try {
|
||||
const text = await vscode.env.clipboard.readText();
|
||||
this._panel?.webview.postMessage({
|
||||
type: 'clipboardText',
|
||||
data: text
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Failed to read clipboard:', error);
|
||||
}
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
if (this._panel) {
|
||||
this._panel.dispose();
|
||||
|
||||
Reference in New Issue
Block a user