Repository: tinkerpop
Updated Branches:
  refs/heads/master 8a4b860b1 -> a8da47f14


Fixed padding in Gremlin Console for multiline scripts

Tested to 100 lines, but it seems to work better now:

gremlin> """1
......1> 2
......2> 3
......3> 4
......4> 5
......5> 6
......6> 7
......7> 8
......8> 89
......9> 0
.....10> 112
.....11> """

The padding is no longer missing a period and stays aligned. Also tested with 
smaller input.prompt size of just "g>". CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a8da47f1
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a8da47f1
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a8da47f1

Branch: refs/heads/master
Commit: a8da47f14f731825d86b0ccaacf8e1187f6d50eb
Parents: 8a4b860
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Oct 12 08:33:41 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Oct 12 08:33:41 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                                              | 1 +
 .../groovy/org/apache/tinkerpop/gremlin/console/Console.groovy  | 5 +----
 2 files changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8da47f1/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index e388816..81f23c6 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -45,6 +45,7 @@ TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET)
 * Fixed a end-step label bug in `MatchPredicateStrategy`.
 * Fixed a bug in `MatchPredicateStrategy` where inlined traversals did not 
have strategies applied to it.
 * Fixed a bug in `RepeatUnrollStrategy` where inlined traversal did not have 
strategies applied to it.
+* Fixed padding of prompt in Gremlin Console when the number of lines went 
beyond a single digit.
 * Added `TraversalHelper.copyLabels()` for copying (or moving) labels form one 
step to another.
 * Added `TraversalHelper.applySingleLevelStrategies()` which will apply a 
subset of strategies but not walk the child tree.
 * Added the concept that hidden labels using during traversal compilation are 
removed at the end during `StandardVerificationStrategy`. (*breaking*)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8da47f1/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
----------------------------------------------------------------------
diff --git 
a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
 
b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
index 19ae3c4..69d6ba3 100644
--- 
a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
+++ 
b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/Console.groovy
@@ -172,10 +172,7 @@ class Console {
             int lineNo = groovy.buffers.current().size() 
             if (lineNo > 0 ) {
                 String lineStr = lineNo.toString() + ">"
-                int pad = Preferences.inputPrompt.length() - lineStr.length() 
+ 2
-                if (pad < 0) {
-                    pad = 0
-                }
+                int pad = Preferences.inputPrompt.length()
                 return Colorizer.render(Preferences.inputPromptColor, 
lineStr.toString().padLeft(pad, '.') + ' ')
             } else {
                 return Colorizer.render(Preferences.inputPromptColor, 
Preferences.inputPrompt + ' ')

Reply via email to