Skip to content

Commit 2e00caa

Browse files
committed
GROOVY-8162: Update Groovysh to JLine3 (document /nano)
1 parent 5807d2c commit 2e00caa

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed
310 KB
Loading
741 KB
Loading

subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ groovy> assert fruit == []
161161
The `def fruit = []` will be _remembered_ before executing each of the next three statements.
162162
--
163163
164+
The shell also has the concept of the "current buffer". This is the collection of all type,
165+
method, imports, and variable definitions. The ordering of these snippets is retained,
166+
which is important for the shell, since it is only executing one snippet at a time,
167+
it typically requires everything needed for a snippet to be pre-defined.
168+
This is different to a compiler which might compile multiple source files at once,
169+
and resolve references between types as needed.
170+
164171
[[GroovyShell-EvaluatingExpressions]]
165172
=== Evaluating Expressions
166173
@@ -519,6 +526,8 @@ Formatting of common file types is supported.
519526
520527
image:assets/img/repl_less.png[Usage of the /less command, width=85%]
521528
529+
If no filename is given, the contents of the current buffer are displayed.
530+
522531
[[GroovyShell-load]]
523532
==== `/load`
524533
@@ -530,10 +539,18 @@ loaded from the `.groovy/groovysh.ser` file in the user home directory.
530539
[[GroovyShell-nano]]
531540
==== `/nano`
532541
533-
Edit the current buffer in an external editor.
542+
Edit files or the current buffer.
543+
544+
The `/nano` command has numerous options:
545+
546+
image:assets/img/repl_nano_help.png[Help for the /nano command, width=100%]
547+
548+
You can use the `/nano` command to edit files or the current buffer:
549+
550+
image:assets/img/repl_nano.png[Using the /nano command, width=80%]
534551
535-
Currently only works on UNIX systems which have the `EDITOR` environment
536-
variable set, or have configured the `editor` preference.
552+
If editing the current buffer, when you exit and then save,
553+
the buffer will be reloaded with the edited contents.
537554
538555
[[GroovyShell-prnt]]
539556
==== `/prnt`

0 commit comments

Comments
 (0)