summaryrefslogtreecommitdiff
path: root/fluid/widget_browser.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-12-04 21:55:21 +0100
committerMatthias Melcher <github@matthiasm.com>2023-12-04 22:03:55 +0100
commit5b96fca1c11daaae8a749090aab2d1d31d0b9510 (patch)
tree58cb7fbd45efca6094a43b5dadfa49ed475610af /fluid/widget_browser.cxx
parentc3849b0a97913add0fae4b3ba3e4bff2a706738d (diff)
#859: FLUID: Improves widget class code formatting
- categorizes multiple comments before a widget class member correctly vs. before a widget member - reintrodues newline characters for comment preview in the widget browser
Diffstat (limited to 'fluid/widget_browser.cxx')
-rw-r--r--fluid/widget_browser.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/fluid/widget_browser.cxx b/fluid/widget_browser.cxx
index b27d7a664..fa1690f12 100644
--- a/fluid/widget_browser.cxx
+++ b/fluid/widget_browser.cxx
@@ -146,6 +146,11 @@ static char *copy_trunc(char *p, const char *str, int maxl, int quote)
const char *end = str + strlen(str); // end of input string
if (quote) *p++ = '"'; // opening quote
while (size < maxl) { // maximum <maxl> characters
+ if (*str == '\n') {
+ *p++ = '\\'; *p++ = 'n';
+ str++; size++;
+ continue;
+ }
if (!(*str & (-32))) break; // end of string (0 or control char)
bs = fl_utf8len(*str); // size of next character
if (bs <= 0) break; // some error - leave