[X2Go-Commits] [x2goclient] 03/03: help.cpp: partly fix indenting algorithm.

git-admin at x2go.org git-admin at x2go.org
Wed Apr 22 21:17:30 CEST 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch bugfix/help-cmd
in repository x2goclient.

commit 7772507d84750006689d406d10293eabe6d37ea2
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Wed Apr 22 21:17:09 2015 +0200

    help.cpp: partly fix indenting algorithm.
---
 src/help.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/help.cpp b/src/help.cpp
index 29bd246..c538868 100644
--- a/src/help.cpp
+++ b/src/help.cpp
@@ -190,12 +190,13 @@ QString help::pretty_print (help::data_t data) {
     out << (*it).first;
     out << QString (" ").repeated (indent);
 
+    /* Append first two spaces to the general indent level for upcoming lines. */
     indent += 2;
     std::ptrdiff_t remaining = 0;
     std::size_t cur_len = (*it).second.size ();
     x2goDebug << "Going to output a description " << (*it).second.size () << " chars wide." << endl;
     if (0 != terminal_cols) {
-      remaining = terminal_cols - indent;
+      remaining = terminal_cols - (indent + (*it).first.size ());
       x2goDebug << "Still have " << remaining << " characters left on this line." << endl;
 
       /* Ran out of space? That's bad... print a newline and don't use any indentation level. */
@@ -244,6 +245,7 @@ QString help::pretty_print (help::data_t data) {
             if (!working_copy.isEmpty ()) {
               out << "\n";
               out << QString (" ").repeated (indent);
+              indent = terminal_cols - remaining;
             }
           }
         }

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git


More information about the x2go-commits mailing list