From 9293188fcedc803a8a5a800007b9ac8febdb00ce Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 4 Mar 2019 15:09:32 +0100 Subject: [PATCH] TUI: better display of stories --- .../nikiroo/fanfix/reader/tui/TuiReaderStoryWindow.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/be/nikiroo/fanfix/reader/tui/TuiReaderStoryWindow.java b/src/be/nikiroo/fanfix/reader/tui/TuiReaderStoryWindow.java index ead70d4..51d8fa0 100644 --- a/src/be/nikiroo/fanfix/reader/tui/TuiReaderStoryWindow.java +++ b/src/be/nikiroo/fanfix/reader/tui/TuiReaderStoryWindow.java @@ -15,6 +15,7 @@ import jexer.event.TResizeEvent; import be.nikiroo.fanfix.data.Chapter; import be.nikiroo.fanfix.data.MetaData; import be.nikiroo.fanfix.data.Paragraph; +import be.nikiroo.fanfix.data.Paragraph.ParagraphType; import be.nikiroo.fanfix.data.Story; import be.nikiroo.fanfix.library.BasicLibrary; @@ -160,7 +161,13 @@ class TuiReaderStoryWindow extends TWindow { builder.append("\n\n"); if (chap != null) { for (Paragraph para : chap) { - builder.append(para.getContent()).append("\n\n"); + if (para.getType() == ParagraphType.BREAK) { + builder.append("\n"); + } + builder.append(para.getContent()).append("\n"); + if (para.getType() == ParagraphType.BREAK) { + builder.append("\n"); + } } } textField.setText(builder.toString()); -- 2.27.0