diff --git a/novelwriter/dialogs/preferences.py b/novelwriter/dialogs/preferences.py index 519f6b73..8d23728a 100644 --- a/novelwriter/dialogs/preferences.py +++ b/novelwriter/dialogs/preferences.py @@ -543,33 +543,6 @@ class GuiPreferences(NDialog): self.tr("Applies to the selected quote styles.") ) - self.allowOpenDial = NSwitch(self) - self.allowOpenDial.setChecked(CONFIG.allowOpenDial) - self.mainForm.addRow( - self.tr("Allow open-ended dialogue"), self.allowOpenDial, - self.tr("Highlight dialogue line with no closing quote.") - ) - - self.narratorBreak = QLineEdit(self) - self.narratorBreak.setMaxLength(1) - self.narratorBreak.setFixedWidth(boxFixed) - self.narratorBreak.setAlignment(QtAlignCenter) - self.narratorBreak.setText(CONFIG.narratorBreak) - self.mainForm.addRow( - self.tr("Dialogue narrator break symbol"), self.narratorBreak, - self.tr("Symbol to indicate injected narrator break.") - ) - - self.dialogLine = QLineEdit(self) - self.dialogLine.setMaxLength(1) - self.dialogLine.setFixedWidth(boxFixed) - self.dialogLine.setAlignment(QtAlignCenter) - self.dialogLine.setText(CONFIG.dialogLine) - self.mainForm.addRow( - self.tr("Dialogue line symbol"), self.dialogLine, - self.tr("Lines starting with this symbol are dialogue.") - ) - self.altDialogOpen = QLineEdit(self) self.altDialogOpen.setMaxLength(4) self.altDialogOpen.setFixedWidth(boxFixed) @@ -587,6 +560,33 @@ class GuiPreferences(NDialog): self.tr("Custom highlighting of dialogue text.") ) + self.allowOpenDial = NSwitch(self) + self.allowOpenDial.setChecked(CONFIG.allowOpenDial) + self.mainForm.addRow( + self.tr("Allow open-ended dialogue"), self.allowOpenDial, + self.tr("Highlight dialogue line with no closing quote.") + ) + + self.dialogLine = QLineEdit(self) + self.dialogLine.setMaxLength(1) + self.dialogLine.setFixedWidth(boxFixed) + self.dialogLine.setAlignment(QtAlignCenter) + self.dialogLine.setText(CONFIG.dialogLine) + self.mainForm.addRow( + self.tr("Dialogue line symbol"), self.dialogLine, + self.tr("Lines starting with this symbol are dialogue.") + ) + + self.narratorBreak = QLineEdit(self) + self.narratorBreak.setMaxLength(1) + self.narratorBreak.setFixedWidth(boxFixed) + self.narratorBreak.setAlignment(QtAlignCenter) + self.narratorBreak.setText(CONFIG.narratorBreak) + self.mainForm.addRow( + self.tr("Dialogue narrator break symbol"), self.narratorBreak, + self.tr("Symbol to indicate injected narrator break.") + ) + self.highlightEmph = NSwitch(self) self.highlightEmph.setChecked(CONFIG.highlightEmph) self.mainForm.addRow( diff --git a/novelwriter/formats/tokenizer.py b/novelwriter/formats/tokenizer.py index 0c6eabdd..9ba26a89 100644 --- a/novelwriter/formats/tokenizer.py +++ b/novelwriter/formats/tokenizer.py @@ -339,8 +339,8 @@ class Tokenizer(ABC): REGEX_PATTERNS.altDialogStyle, (TextFmt.COL_B, "altdialog"), (TextFmt.COL_E, ""), )) - self._dialogLine = CONFIG.dialogLine - self._narratorBreak = CONFIG.narratorBreak + self._dialogLine = CONFIG.dialogLine.strip()[:1] + self._narratorBreak = CONFIG.narratorBreak.strip()[:1] return def setTitleMargins(self, upper: float, lower: float) -> None: diff --git a/novelwriter/gui/dochighlight.py b/novelwriter/gui/dochighlight.py index 1931640e..24c4d373 100644 --- a/novelwriter/gui/dochighlight.py +++ b/novelwriter/gui/dochighlight.py @@ -136,8 +136,8 @@ class GuiDocHighlighter(QSyntaxHighlighter): self._txtRules.clear() self._cmnRules.clear() - self._dialogLine = CONFIG.dialogLine - self._narratorBreak = CONFIG.narratorBreak + self._dialogLine = CONFIG.dialogLine.strip()[:1] + self._narratorBreak = CONFIG.narratorBreak.strip()[:1] # Multiple or Trailing Spaces if CONFIG.showMultiSpaces: