Lines Matching refs:cursor
162 const cursorPos = repl.line.length !== repl.cursor ?
184 // Prevent cursor moves if not necessary!
185 const move = repl.line.length !== repl.cursor;
273 if (repl.line.length !== repl.cursor) {
491 const currentCursor = repl.cursor;
527 let cursor = -1;
551 cursor = -1;
579 // Update the cursor in case it's necessary.
580 if (cursor === -1) {
581 cursor = entry.length;
583 cursor = StringPrototypeLastIndexOf(entry, input, cursor - 1);
585 cursor = StringPrototypeIndexOf(entry, input, cursor + 1);
588 if (cursor === -1) {
593 const start = StringPrototypeSlice(entry, 0, cursor);
594 const end = StringPrototypeSlice(entry, cursor + input.length);
597 print(entry, `${labels[dir]}${input}_`, cursor);
599 lastCursor = cursor;
602 if ((dir === 'r' && cursor === 0) ||
603 (dir === 's' && entry.length === cursor + input.length)) {
612 function print(outputLine, inputLine, cursor = repl.cursor) {
630 // repl.setCursor(cursor);
632 // Multiple cursor moves on the same tick could be prevented in case all
633 // writes from the same tick are combined and the cursor is moved at the
656 // To know exactly how many rows we have to move the cursor back we need the
657 // cursor rows, the output rows and the input rows.
659 const cursorLine = prompt + StringPrototypeSlice(outputLine, 0, cursor);
679 repl.cursor = lastCursor;
691 if (repl.line.length !== repl.cursor) {
700 cursor = -1;