Edit active document
Edit active document logo by KTrain5369
Limitations
Section titled “Limitations”There is a 100,000 character limit for all editing actions.
Cursor
Section titled “Cursor”See also: Reference/Cursor
Neuro gains her own cursor if she is allowed to edit the active document. This ensures that her activities won’t be disrupted by moving the real cursor.
Get Cursor
Section titled “Get Cursor”This sends the current cursor position to Neuro, alongside surrounding lines as context.
Place Cursor
Section titled “Place Cursor”This places Neuro’s virtual cursor at her desired spot. Once that is placed, she will also get her cursor’s surrounding lines as context.
Get File Contents
Section titled “Get File Contents”Gets the contents of the entire file. The context sent will be more or less the same as the Send Current File as Context command.
Insert/Replace/Delete/Find Text
Section titled “Insert/Replace/Delete/Find Text”This gives Neuro the ability to insert, replace, delete or find text within the active document.
Inserting will insert at Neuro’s cursor. For all other options, Neuro can choose to use either exact pattern searches or regex to search for the targeted text.
Insert Lines
Section titled “Insert Lines”A special variant of the Insert Text action that automatically adds below a line rather than at the cursor. By default it inserts below the cursor.
Rewrite Lines
Section titled “Rewrite Lines”Rewrites the specified range of lines with the given content and places the cursor at the end of the last inserted line.
Delete Lines
Section titled “Delete Lines”Deletes the specified range of lines and moves the cursor to the end of the previous line.
Highlight Lines
Section titled “Highlight Lines”Allows Neuro to highlight a set of lines. These lines will be displayed as pink highlights across the lines targeted. This is purely for attention-grabbing.
Rewrite All
Section titled “Rewrite All”Completely rewrites the contents of the file and places the cursor at the start of the file.
This allows Neuro to undo the last editing action.
This allows Neuro to manually save the current document.
This action is only registered if the autoSave setting is set to any value other than afterDelay.
Passive saving notifications
Section titled “Passive saving notifications”In addition to being informed if she saved successfully, enabling Send Save Notifications will allow Neuro to receive save notifications as the active document is saved.
Get User Cursor
Section titled “Get User Cursor”Gets the cursor of the current user.
Replace User Selection
Section titled “Replace User Selection”Replaces the current user selection.
If requireSelectionUnchanged is set to true and the selection was changed (or there is no selection info already stored), this requires that Neuro get the current user cursor’s context in some way first.
This can be either with her Get User Cursor action or by sending it via the Send Current Selection as Context command.
Diff Patch
Section titled “Diff Patch”Allows Neuro to write diff patches to modify the file. Intended as a more direct way of modifying the file.
Patches are written in a pseudo-search-replace-diff format.
>>>>>> SEARCH and <<<<<< REPLACE are used to denote the text to search and text to replace.
These are separated by ====== in the middle.
See the following example:
def turtle(): return "Vedal"To apply a diff like this:
def turtle(): return "Vedal" return "insert_turtle_here"Neuro would need to write this patch:
>>>>>> SEARCHdef turtle(): return "Vedal"======def turtle(): return "insert_turtle_here"<<<<<< REPLACE