MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / requestRender

Method requestRender

packages/pi-tui/src/tui.ts:722–749  ·  view source on GitHub ↗
(force = false)

Source from the content-addressed store, hash-verified

720 }
721
722 requestRender(force = false): void {
723 if (force) {
724 this.previousLines = [];
725 this.previousWidth = -1; // -1 triggers widthChanged, forcing a full clear
726 this.previousHeight = -1; // -1 triggers heightChanged, forcing a full clear
727 this.cursorRow = 0;
728 this.hardwareCursorRow = 0;
729 this.maxLinesRendered = 0;
730 this.previousViewportTop = 0;
731 if (this.renderTimer) {
732 clearTimeout(this.renderTimer);
733 this.renderTimer = undefined;
734 }
735 this.renderRequested = true;
736 process.nextTick(() => {
737 if (this.stopped || !this.renderRequested) {
738 return;
739 }
740 this.renderRequested = false;
741 this.lastRenderAt = performance.now();
742 this.doRender();
743 });
744 return;
745 }
746 if (this.renderRequested) return;
747 this.renderRequested = true;
748 process.nextTick(() => this.scheduleRender());
749 }
750
751 private scheduleRender(): void {
752 if (this.stopped || this.renderTimer || !this.renderRequested) {

Callers 8

mainFunction · 0.95
setShowHardwareCursorMethod · 0.95
showOverlayMethod · 0.95
hideOverlayMethod · 0.95
startMethod · 0.95
handleInputMethod · 0.95
createTUIStateFunction · 0.95

Calls 3

doRenderMethod · 0.95
scheduleRenderMethod · 0.95
nowMethod · 0.65

Tested by

no test coverage detected