Lines Matching refs:cursor

321     this.cursor = 0;
395 if (!preserveCursor) this.cursor = 0;
490 // cursor position
493 // First move to the bottom of the current line, based on cursor pos
512 // Move cursor to original position.
630 this[kBeforeEdit](this.line, this.cursor);
631 if (this.cursor < this.line.length) {
632 const beg = StringPrototypeSlice(this.line, 0, this.cursor);
635 this.cursor,
639 this.cursor += c.length;
644 this.cursor += c.length;
657 const string = StringPrototypeSlice(this.line, 0, this.cursor);
688 this.cursor - completeOn.length) +
691 this.cursor,
693 this.cursor = this.cursor - completeOn.length + prefix.length;
702 this[kBeforeEdit](this.line, this.cursor);
741 if (this.cursor > 0) {
744 const leading = StringPrototypeSlice(this.line, 0, this.cursor);
755 if (this.cursor < this.line.length) {
756 const trailing = StringPrototypeSlice(this.line, this.cursor);
763 if (this.cursor > 0 && this.line.length > 0) {
764 this[kBeforeEdit](this.line, this.cursor);
766 const charSize = charLengthLeft(this.line, this.cursor);
768 StringPrototypeSlice(this.line, 0, this.cursor - charSize) +
769 StringPrototypeSlice(this.line, this.cursor, this.line.length);
771 this.cursor -= charSize;
777 if (this.cursor < this.line.length) {
778 this[kBeforeEdit](this.line, this.cursor);
780 const charSize = charLengthAt(this.line, this.cursor);
782 StringPrototypeSlice(this.line, 0, this.cursor) +
785 this.cursor + charSize,
793 if (this.cursor > 0) {
794 this[kBeforeEdit](this.line, this.cursor);
797 let leading = StringPrototypeSlice(this.line, 0, this.cursor);
810 StringPrototypeSlice(this.line, this.cursor, this.line.length);
811 this.cursor = leading.length;
817 if (this.cursor < this.line.length) {
818 this[kBeforeEdit](this.line, this.cursor);
819 const trailing = StringPrototypeSlice(this.line, this.cursor);
822 StringPrototypeSlice(this.line, 0, this.cursor) +
829 this[kBeforeEdit](this.line, this.cursor);
830 const del = StringPrototypeSlice(this.line, 0, this.cursor);
831 this.line = StringPrototypeSlice(this.line, this.cursor);
832 this.cursor = 0;
838 this[kBeforeEdit](this.line, this.cursor);
839 const del = StringPrototypeSlice(this.line, this.cursor);
840 this.line = StringPrototypeSlice(this.line, 0, this.cursor);
872 StringPrototypeSlice(this.line, 0, this.cursor - lastYank.length);
874 StringPrototypeSlice(this.line, this.cursor);
876 this.cursor = head.length + currentYank.length;
885 this.cursor = 0;
897 [kPushToUndoStack](text, cursor) {
898 if (ArrayPrototypePush(this[kUndoStack], { text, cursor }) >
909 { text: this.line, cursor: this.cursor },
914 this.cursor = entry.cursor;
924 { text: this.line, cursor: this.cursor },
929 this.cursor = entry.cursor;
943 this[kBeforeEdit](this.line, this.cursor);
959 this.cursor = this.line.length; // Set cursor to end of line.
966 this[kBeforeEdit](this.line, this.cursor);
982 this.cursor = this.line.length; // Set cursor to end of line.
1022 * Returns the real position of the cursor in relation
1031 this[kPrompt] + StringPrototypeSlice(this.line, 0, this.cursor);
1035 // This function moves cursor dx places to the right
1042 this.cursor += dx;
1045 if (this.cursor < 0) {
1046 this.cursor = 0;
1047 } else if (this.cursor > this.line.length) {
1048 this.cursor = this.line.length;
1053 // Check if cursor stayed on the line.
1084 this.cursor,
1144 if (this.cursor === 0 && this.line.length === 0) {
1147 } else if (this.cursor < this.line.length) {
1169 this[kMoveCursor](-charLengthLeft(this.line, this.cursor));
1173 this[kMoveCursor](+charLengthAt(this.line, this.cursor));
1207 // Explicitly re-enable "raw mode" and move the cursor to
1296 this[kMoveCursor](-charLengthLeft(this.line, this.cursor));
1300 this[kMoveCursor](+charLengthAt(this.line, this.cursor));