mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 21:03:42 +00:00
feat(coding-agent): clipboard image paste support via Ctrl+V (fixes #419)
This commit is contained in:
parent
97bb411988
commit
5c5084481b
8 changed files with 233 additions and 2 deletions
|
|
@ -408,7 +408,9 @@ export class Editor implements Component {
|
|||
const endIndex = this.pasteBuffer.indexOf("\x1b[201~");
|
||||
if (endIndex !== -1) {
|
||||
const pasteContent = this.pasteBuffer.substring(0, endIndex);
|
||||
this.handlePaste(pasteContent);
|
||||
if (pasteContent.length > 0) {
|
||||
this.handlePaste(pasteContent);
|
||||
}
|
||||
this.isInPaste = false;
|
||||
const remaining = this.pasteBuffer.substring(endIndex + 6);
|
||||
this.pasteBuffer = "";
|
||||
|
|
@ -707,6 +709,16 @@ export class Editor implements Component {
|
|||
this.setTextInternal(text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert text at the current cursor position.
|
||||
* Used for programmatic insertion (e.g., clipboard image markers).
|
||||
*/
|
||||
insertTextAtCursor(text: string): void {
|
||||
for (const char of text) {
|
||||
this.insertCharacter(char);
|
||||
}
|
||||
}
|
||||
|
||||
// All the editor methods from before...
|
||||
private insertCharacter(char: string): void {
|
||||
this.historyIndex = -1; // Exit history browsing mode
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue