GitHub user tkruse opened a pull request: https://github.com/apache/incubator-groovy/pull/92
Completion fixes This PR contains multiple minor fixes for tab completion in groovysh. I detected those while working on upgrading to jline 2.13. The main fix is for completion of files or folders with blanks or hyphens in the name. The previous implementation tried to juggle with opening and closing hyphens, but this caused several bugs. Aside from this, I changed a bit the handling of blanks, such that completion of a command without arguments (like ```:exit```) is not completed with a blank at the end, suggesting more arguments are expected/allowed. You can merge this pull request into a Git repository by running: $ git pull https://github.com/tkruse/incubator-groovy completion-fix Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-groovy/pull/92.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #92 ---- commit 526f3669739b650e9fb478641706f4b5cbc662a3 Author: Thibault Kruse <thibault.kr...@gmx.de> Date: 2015-08-11T22:32:42Z groovysh: fix logging (bad variable) commit 8d8cab372fab3de4afc53740c38d055d14c3667c Author: Thibault Kruse <thibault.kr...@gmx.de> Date: 2015-08-19T12:28:28Z groovysh: Fixes some missing / superfluous blanks after command completion Argument Completion should not add blanks when no further argument is allowed SimpleCommand does not add blank after single candidate, because semantics of added blank is that another argument is expected/allowed commit 07fe8241fd0e0e00f8b75c9a381fb28741dc16c0 Author: Thibault Kruse <thibault.kr...@gmx.de> Date: 2015-08-19T12:41:14Z groovysh: Minor style fixes and rename consistent with jline2.13 commit 6a101af20a18248a2fe2bef5d3949885ce1e3a68 Author: Thibault Kruse <thibault.kr...@gmx.de> Date: 2015-08-19T12:44:59Z groovysh: refactor code for dealing with '~': call getUserHome only when needed commit eb18a984d5ff74195a7977fd921c0b44e323de5e Author: Thibault Kruse <thibault.kr...@gmx.de> Date: 2015-08-19T13:44:56Z groovysh: Fix CommandArgumentParser problems with escaping commit d459f9831c9eb4988d43e609586cb02549cf0534 Author: Thibault Kruse <thibault.kr...@gmx.de> Date: 2015-08-20T12:36:06Z groovysh: Fix file completion with blanks, use escaping instead of hyphens Trying to close hyphens leads to complex/buggy code. As an example, completing: ```:load "foo|``` with candidate file 'foo bar' leads to ```:load "'foo bar'``` because jline does not pass the initial hyphen to the FileNameCompleter. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---