This is an automated email from the git hooks/post-receive script. x2go pushed a change to branch bugfix/help-cmd in repository x2goclient. from 7772507 help.cpp: partly fix indenting algorithm. new fb9b1b0 help.cpp: actually recalculate the new indent *before* writing whitespace. new d3ff608 help.cpp: fix splitting algorithm to step over a space character, but include hyphens correctly into the current line. The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Summary of changes: debian/changelog | 2 ++ src/help.cpp | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
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 fb9b1b028a35dff3261907d6a3940601152e1d08 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 22 21:22:51 2015 +0200 help.cpp: actually recalculate the new indent *before* writing whitespace. --- src/help.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/help.cpp b/src/help.cpp index c538868..ff8dc99 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -244,8 +244,8 @@ QString help::pretty_print (help::data_t data) { /* Do the next chunk, if there are remaining characters. */ if (!working_copy.isEmpty ()) { out << "\n"; - out << QString (" ").repeated (indent); indent = terminal_cols - remaining; + out << QString (" ").repeated (indent); } } } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git
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 d3ff608ca531707131687dcc55bc281d07224764 Author: Mihai Moldovan <ionic@ionic.de> Date: Wed Apr 22 21:47:19 2015 +0200 help.cpp: fix splitting algorithm to step over a space character, but include hyphens correctly into the current line. --- debian/changelog | 2 ++ src/help.cpp | 17 +++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8c447f3..9396918 100644 --- a/debian/changelog +++ b/debian/changelog @@ -277,6 +277,8 @@ x2goclient (4.0.4.0-0x2go1) UNRELEASED; urgency=low - help.cpp: clear current string if completely written onto one line. - help.cpp: enable debugging for pretty_print(). --debug must be supplied before --help for this to work. + - help.cpp: fix splitting algorithm to step over a space character, but + include hyphens correctly into the current line. [ Fernando Pedemonte ] * New upstream release (4.0.4.0): diff --git a/src/help.cpp b/src/help.cpp index ff8dc99..8a7a715 100644 --- a/src/help.cpp +++ b/src/help.cpp @@ -221,8 +221,12 @@ QString help::pretty_print (help::data_t data) { } else { /* Try to find the next split point. */ - std::ptrdiff_t split_point_white = working_copy.lastIndexOf (" ", remaining); - std::ptrdiff_t split_point_hyphen = working_copy.lastIndexOf ("-", remaining); + std::ptrdiff_t split_point_white = working_copy.lastIndexOf (" ", remaining - 1); + std::ptrdiff_t split_point_hyphen = working_copy.lastIndexOf ("-", remaining - 1); + + /* Make sure the hyphen is part of the current line. */ + ++split_point_hyphen; + std::ptrdiff_t split_point = std::max (split_point_white, split_point_hyphen); if (-1 == split_point) { @@ -232,14 +236,11 @@ QString help::pretty_print (help::data_t data) { } else { /* Yay, we can split. */ + x2goDebug << "Split onto " << working_copy.left (split_point); out << working_copy.left (split_point); - /* If we split at a hyphen, don't lose it. */ - if (working_copy.at (split_point) == '-') { - out << "-"; - } - - working_copy = working_copy.mid (split_point); + x2goDebug << " and new part " << working_copy.mid (split_point + 1); + working_copy = working_copy.mid (split_point + 1); /* Do the next chunk, if there are remaining characters. */ if (!working_copy.isEmpty ()) { -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git