Skip to content

Commit 2c12fd6

Browse files
author
Dave
authored
DOCSP-22047 clarify edit autoload (#202)
* DOCSP-22047 Clarify edit autoload * DOCSP-22047 Clarify edit autoload * Review updates
1 parent 5030b19 commit 2c12fd6

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

source/reference/editor-mode.txt

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,11 @@ The ``nano`` editor will open when you run ``edit`` in the
194194
Editing a Command
195195
~~~~~~~~~~~~~~~~~
196196

197-
Use ``edit`` to modify the last edit.
197+
Use ``edit`` to start an editing session. If the editor was already
198+
used in the current console session, the editor opens the last edit.
198199

199-
This statement was just written in the external editor. Unfortunately,
200-
it has a syntax error. The highlighted line is missing a comma:
200+
The following statement has a syntax error. The highlighted line is
201+
missing a comma:
201202

202203
.. code-block:: javascript
203204
:emphasize-lines: 4
@@ -211,8 +212,18 @@ it has a syntax error. The highlighted line is missing a comma:
211212
{ "name": "Paola", "group": "marketing" }
212213
] )
213214

214-
Enter ``edit`` without any arguments to re-edit the command. The
215-
external editor reloads the last edit.
215+
To set up the example:
216+
217+
#. Copy the example code.
218+
#. Enter ``edit`` to start an editing session.
219+
#. Paste the example code into the editor.
220+
#. Exit the editor.
221+
#. Press ``enter``.
222+
223+
When you exit the editor, it copies the example code to the command
224+
line. :binary:`mongosh` returns an error when the code runs.
225+
226+
To reload the example code, enter ``edit`` without any arguments.
216227

217228
.. code-block:: javascript
218229
:copyable: false

0 commit comments

Comments
 (0)