|
wxMaxima
|
Splits a line of plain text Maxima sends into the pieces the worksheet may break it into lines between. More...
#include <wx/string.h>#include <vector>Go to the source code of this file.
Functions | |
| bool | wxm::IsTextBreakChar (wxUniChar ch) |
| Is a line break allowed after this character? | |
| std::vector< wxString > | wxm::SplitAtTextBreaks (const wxString &line) |
| Split one line of text (no newlines) after the characters a line may be broken after. | |
Splits a line of plain text Maxima sends into the pieces the worksheet may break it into lines between.
Text Maxima sends outside of its XML – warnings, errors, status messages, printf() output – used to become one cell per line. The worksheet only breaks output between cells, so a long message ran off the right edge of the window. MaximaOutputAppender::DoRawConsoleAppend() therefore turns such a line into one TextCell per piece returned here, the pieces after the first marked as continuing the one before (TextCell::IsTextContinuation()), so that, as long as the line fits, it looks exactly as it did before.
Text Maxima marks as 2D ASCII-art maths (<wxxml-asciimath>) is never split: its columns only line up if every line stays in one piece.
GUI-free, so test_TextBreaks can pin it directly.
| bool wxm::IsTextBreakChar | ( | wxUniChar | ch | ) |
Is a line break allowed after this character?
True for a space, a tab, "+", "-", ",", ";", ".", "*" and "/".
| std::vector< wxString > wxm::SplitAtTextBreaks | ( | const wxString & | line | ) |
Split one line of text (no newlines) after the characters a line may be broken after.
Concatenating the pieces always gives back line unchanged. The character that allows the break stays at the end of the piece before the break. A run of such characters stays together (", " breaks after the space, "--" after the second "-"), and the line isn't broken