summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gmdocument.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gmdocument.c b/src/gmdocument.c
index 7ee7839e..e756a9d9 100644
--- a/src/gmdocument.c
+++ b/src/gmdocument.c
@@ -340,6 +340,7 @@ static void doLayout_GmDocument_(iGmDocument *d) {
340 const iPrefs *prefs = prefs_App(); 340 const iPrefs *prefs = prefs_App();
341 const iBool isMono = isForcedMonospace_GmDocument_(d); 341 const iBool isMono = isForcedMonospace_GmDocument_(d);
342 const iBool isNarrow = d->size.x < 90 * gap_Text; 342 const iBool isNarrow = d->size.x < 90 * gap_Text;
343 const iBool isVeryNarrow = d->size.x <= 65 * gap_Text;
343 const iBool isDarkBg = isDark_GmDocumentTheme( 344 const iBool isDarkBg = isDark_GmDocumentTheme(
344 isDark_ColorTheme(colorTheme_App()) ? prefs->docThemeDark : prefs->docThemeLight); 345 isDark_ColorTheme(colorTheme_App()) ? prefs->docThemeDark : prefs->docThemeLight);
345 /* TODO: Collect these parameters into a GmTheme. */ 346 /* TODO: Collect these parameters into a GmTheme. */
@@ -685,8 +686,15 @@ static void doLayout_GmDocument_(iGmDocument *d) {
685 if (!prefs->quoteIcon && type == quote_GmLineType) { 686 if (!prefs->quoteIcon && type == quote_GmLineType) {
686 run.flags |= quoteBorder_GmRunFlag; 687 run.flags |= quoteBorder_GmRunFlag;
687 } 688 }
688 rightMargin = (type == text_GmLineType || type == bullet_GmLineType || 689 /* The right margin is used for balancing lines horizontally. */
689 type == quote_GmLineType ? 4 : 0); 690 if (isVeryNarrow) {
691 rightMargin = 0;
692 }
693 else {
694 rightMargin = (type == text_GmLineType || type == bullet_GmLineType ||
695 type == quote_GmLineType ? 4 : 0);
696 }
697
690 const iBool isWordWrapped = 698 const iBool isWordWrapped =
691 (d->format == plainText_GmDocumentFormat ? prefs->plainTextWrap : !isPreformat); 699 (d->format == plainText_GmDocumentFormat ? prefs->plainTextWrap : !isPreformat);
692 if (isPreformat && d->format != plainText_GmDocumentFormat) { 700 if (isPreformat && d->format != plainText_GmDocumentFormat) {