MCPcopy Index your code
hub / github.com/nodejs/node / getPreviewPos

Function getPreviewPos

lib/internal/repl/utils.js:164–170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162 let escaped = null;
163
164 function getPreviewPos() {
165 const displayPos = repl._getDisplayPos(`${repl.getPrompt()}${repl.line}`);
166 const cursorPos = repl.line.length !== repl.cursor ?
167 repl.getCursorPos() :
168 displayPos;
169 return { displayPos, cursorPos };
170 }
171
172 function isCursorAtInputEnd() {
173 const { cursorPos, displayPos } = getPreviewPos();

Callers 4

isCursorAtInputEndFunction · 0.85
clearPreviewFunction · 0.85
showCompletionPreviewFunction · 0.85
inputPreviewCallbackFunction · 0.85

Calls 2

getPromptMethod · 0.80
getCursorPosMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…