Fix error wrapping in interactive selection input
authorTeemu Murtola <teemu.murtola@gmail.com>
Mon, 29 Jun 2015 10:02:11 +0000 (13:02 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Sat, 4 Jul 2015 19:02:07 +0000 (21:02 +0200)
commit812ab9cc9fc5380bd3ffcae9a10dff8a964fda21
tree1d6d27288767005e4f06ec38ff01e71fa3db6e3b
parentaa40ec1fd149313b4402c12dfc499da54abe68d3
Fix error wrapping in interactive selection input

Resolve a TODO that was introduced when making the selection prompting
use text streams about wrapping error messages like they used to be
wrapped.

The use of console width within the generic error formatting code is a
bit ugly, but that needs to be resolved separately (and the old code
also had the console width hardcoded in a similar level).

Change-Id: Ia832a4884eef9bded50431fb5008d8191f52c246
14 files changed:
src/gromacs/selection/selectioncollection.cpp
src/gromacs/utility/exceptions.cpp
src/gromacs/utility/stringutil.cpp
src/gromacs/utility/stringutil.h
src/gromacs/utility/tests/CMakeLists.txt
src/gromacs/utility/tests/refdata/TextLineWrapperTest_WrapsCorrectlyWithExtraWhitespace.xml
src/gromacs/utility/tests/refdata/TextWriterTest_WritesLines.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TextWriterTest_WritesLinesInParts.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TextWriterTest_WritesLinesInPartsWithWrapper.xml [new file with mode: 0644]
src/gromacs/utility/tests/refdata/TextWriterTest_WritesWrappedLines.xml [new file with mode: 0644]
src/gromacs/utility/tests/stringutil.cpp
src/gromacs/utility/tests/textwriter.cpp [new file with mode: 0644]
src/gromacs/utility/textwriter.cpp
src/gromacs/utility/textwriter.h