# HG changeset patch # User František Kučera # Date 1390259464 -3600 # Node ID 8f142472270c8fcbdf19093b6c0b89f2431477d3 # Parent 4e131a0b521acd4b4b3c18da877687d8316e9771 Tabular: replace also Non-breaking space with colored symbol (like newlines and TABs) diff -r 4e131a0b521a -r 8f142472270c java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java --- a/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java Mon Jan 20 23:58:57 2014 +0100 +++ b/java/sql-dk/src/info/globalcode/sql/dk/formatting/TabularFormatter.java Tue Jan 21 00:11:04 2014 +0100 @@ -44,7 +44,8 @@ public static final String PROPERTY_ASCII = "ascii"; public static final String PROPERTY_COLORFUL = "color"; public static final String PROPERTY_TRIM = "trim"; - private static final Pattern whitespaceToReplace = Pattern.compile("\\n|\\t"); + private static final String NBSP = " "; + private static final Pattern whitespaceToReplace = Pattern.compile("\\n|\\t|" + NBSP); protected ColorfulPrintWriter out; private boolean firstResult = true; private int[] columnWidth; @@ -284,6 +285,9 @@ case "\t": out.print(TerminalColor.Red, "↹"); break; + case NBSP: + out.print(TerminalColor.Red, "⎵"); + break; default: throw new IllegalStateException("Unexpected whitespace token: „" + m.group() + "“"); }