MCPcopy Create free account
hub / github.com/continuedev/continue / finalizeRapidInput

Method finalizeRapidInput

extensions/cli/src/ui/TextBuffer.ts:390–415  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

388
389 // Called after rapid input timer expires to collapse or insert buffered content
390 private finalizeRapidInput(): void {
391 if (this._rapidInputBuffer.length > COLLAPSE_SIZE) {
392 const placeholder = this.createPlaceholder(this._rapidInputBuffer);
393 this._pasteMap.set(placeholder, this._rapidInputBuffer);
394
395 this._text =
396 this._text.slice(0, this._rapidInputStartPos) +
397 placeholder +
398 this._text.slice(this._rapidInputStartPos);
399 this._cursor = this._rapidInputStartPos + placeholder.length;
400
401 if (this._onStateChange) {
402 this._onStateChange();
403 }
404 } else {
405 this.insertText(this._rapidInputBuffer);
406
407 if (this._onStateChange) {
408 this._onStateChange();
409 }
410 }
411
412 this._rapidInputBuffer = "";
413 this._rapidInputStartPos = 0;
414 this._rapidInputTimer = null;
415 }
416
417 private handleOptionKey(sequence: string): boolean {
418 // Option + backspace (usually \u001b\u0008 or \u001b\u007f)

Callers 3

flushPendingInputMethod · 0.95
handleRapidInputMethod · 0.95
handleTextInputMethod · 0.95

Calls 3

createPlaceholderMethod · 0.95
insertTextMethod · 0.95
setMethod · 0.65

Tested by

no test coverage detected