MCPcopy
hub / github.com/codeaashu/claude-code / modifyText

Method modifyText

src/utils/Cursor.ts:845–859  ·  view source on GitHub ↗
(end: Cursor, insertString: string = '')

Source from the content-addressed store, hash-verified

843 }
844
845 modifyText(end: Cursor, insertString: string = ''): Cursor {
846 const startOffset = this.offset
847 const endOffset = end.offset
848
849 const newText =
850 this.text.slice(0, startOffset) +
851 insertString +
852 this.text.slice(endOffset)
853
854 return Cursor.fromText(
855 newText,
856 this.columns,
857 startOffset + insertString.normalize('NFC').length,
858 )
859 }
860
861 insert(insertString: string): Cursor {
862 const newCursor = this.modifyText(this, insertString)

Callers 9

insertMethod · 0.95
delMethod · 0.95
deleteToLineEndMethod · 0.95
deleteWordBeforeMethod · 0.95
deleteTokenBeforeMethod · 0.95
deleteWordAfterMethod · 0.95
backspaceMethod · 0.80
deleteToLineStartMethod · 0.80

Calls 1

fromTextMethod · 0.80

Tested by

no test coverage detected