From 155f3d757fc89bd5717630965b66e325f47265d5 Mon Sep 17 00:00:00 2001 From: Philipp Salvisberg Date: Thu, 6 Jan 2022 14:26:46 +0100 Subject: [PATCH 1/2] change default host for testing database --- sqldev/src/test/resources/test.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqldev/src/test/resources/test.properties b/sqldev/src/test/resources/test.properties index 3b8b4b51..9c71960d 100644 --- a/sqldev/src/test/resources/test.properties +++ b/sqldev/src/test/resources/test.properties @@ -1,5 +1,5 @@ # properties to connect to Oracle Database using JDBC thin driver -host=localhost +host=fillmore port=1521 service=odb.docker From dde8e11023d4d3474aea3e507312163461821888 Mon Sep 17 00:00:00 2001 From: Philipp Salvisberg Date: Thu, 6 Jan 2022 14:28:53 +0100 Subject: [PATCH 2/2] fixes #140 - Do not suppress multiple consecutive spaces --- .../java/org/utplsql/sqldev/ui/runner/RunnerPanel.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sqldev/src/main/java/org/utplsql/sqldev/ui/runner/RunnerPanel.java b/sqldev/src/main/java/org/utplsql/sqldev/ui/runner/RunnerPanel.java index fec6c0e4..c0d44d33 100644 --- a/sqldev/src/main/java/org/utplsql/sqldev/ui/runner/RunnerPanel.java +++ b/sqldev/src/main/java/org/utplsql/sqldev/ui/runner/RunnerPanel.java @@ -923,6 +923,13 @@ private String getLinkedAndFormattedText(final String text) { localText = localText.substring(0, start) + title + localText.substring(end); m = p3.matcher(localText); } + // replaces two consecutive spaces with two non-breaking spaces to fix #140 + // assume that consecutive spaces do not conflict with previous replacements + // using CSS "white-space: pre-wrap;" does not work within Swing, it's simply ignored. + // See https://docs.oracle.com/javase/8/docs/api/javax/swing/text/html/CSS.html + // putting text in pre tags is not an option, because this suppresses wrap. + localText = localText.replaceAll(" ", "  "); + // add paragraph for each line to preserve line breaks StringBuilder sb = new StringBuilder(); for (final String p : localText.split("\n")) { sb.append("

");