This is an automated email from the ASF dual-hosted git repository. paulk pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/groovy.git
commit 2e00caacab5763349777f3da9abc2063aa0b54cd Author: Paul King <[email protected]> AuthorDate: Mon Aug 4 18:35:22 2025 +1000 GROOVY-8162: Update Groovysh to JLine3 (document /nano) --- .../src/spec/doc/assets/img/repl_nano.png | Bin 0 -> 317082 bytes .../src/spec/doc/assets/img/repl_nano_help.png | Bin 0 -> 758911 bytes .../groovy-groovysh/src/spec/doc/groovysh.adoc | 23 ++++++++++++++++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_nano.png b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_nano.png new file mode 100644 index 0000000000..4ec30a85e9 Binary files /dev/null and b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_nano.png differ diff --git a/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_nano_help.png b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_nano_help.png new file mode 100644 index 0000000000..4523f5879b Binary files /dev/null and b/subprojects/groovy-groovysh/src/spec/doc/assets/img/repl_nano_help.png differ diff --git a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc index dbacd30955..eff8bffe0f 100644 --- a/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc +++ b/subprojects/groovy-groovysh/src/spec/doc/groovysh.adoc @@ -161,6 +161,13 @@ groovy> assert fruit == [] The `def fruit = []` will be _remembered_ before executing each of the next three statements. -- +The shell also has the concept of the "current buffer". This is the collection of all type, +method, imports, and variable definitions. The ordering of these snippets is retained, +which is important for the shell, since it is only executing one snippet at a time, +it typically requires everything needed for a snippet to be pre-defined. +This is different to a compiler which might compile multiple source files at once, +and resolve references between types as needed. + [[GroovyShell-EvaluatingExpressions]] === Evaluating Expressions @@ -519,6 +526,8 @@ Formatting of common file types is supported. image:assets/img/repl_less.png[Usage of the /less command, width=85%] +If no filename is given, the contents of the current buffer are displayed. + [[GroovyShell-load]] ==== `/load` @@ -530,10 +539,18 @@ loaded from the `.groovy/groovysh.ser` file in the user home directory. [[GroovyShell-nano]] ==== `/nano` -Edit the current buffer in an external editor. +Edit files or the current buffer. + +The `/nano` command has numerous options: + +image:assets/img/repl_nano_help.png[Help for the /nano command, width=100%] + +You can use the `/nano` command to edit files or the current buffer: + +image:assets/img/repl_nano.png[Using the /nano command, width=80%] -Currently only works on UNIX systems which have the `EDITOR` environment -variable set, or have configured the `editor` preference. +If editing the current buffer, when you exit and then save, +the buffer will be reloaded with the edited contents. [[GroovyShell-prnt]] ==== `/prnt`
