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 b5622c64ab49f0e356c33fee51144bc42e2fe8ba
Author: Paul King <pa...@asert.com.au>
AuthorDate: Tue Aug 5 21:28:49 2025 +1000

    GROOVY-8162: Update Groovysh to JLine3 (fix /!ls handling regression)
---
 .../groovy/org/apache/groovy/groovysh/jline/GroovySystemRegistry.groovy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovySystemRegistry.groovy
 
b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovySystemRegistry.groovy
index 8bfb7277d2..e3b0350823 100644
--- 
a/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovySystemRegistry.groovy
+++ 
b/subprojects/groovy-groovysh/src/main/groovy/org/apache/groovy/groovysh/jline/GroovySystemRegistry.groovy
@@ -36,6 +36,7 @@ class GroovySystemRegistry extends SystemRegistryImpl {
     // workaround for: https://github.com/jline/jline3/issues/1361
     @Override
     Object execute(String line) throws Exception {
+        line = line.startsWith("/!") ? line.replaceFirst("/!", "/! ") : line
         def m = line =~ /([a-zA-Z][a-zA-Z0-9_]*)(\s*)=(\s*)(\/?)(\S.*)/
         def target = null
         if (m.matches()) {
@@ -43,7 +44,6 @@ class GroovySystemRegistry extends SystemRegistryImpl {
             if (slash) {
                 target = variable
                 line = slash + rhs
-                line = line.startsWith("/!") ? line.replaceFirst("/!", "/! ") 
: line
             } else {
                 space1 = space1.size() == 0 ? ' ' : space1
                 space2 = space2.size() == 0 ? ' ' : space2

Reply via email to