diff --git a/novelwriter/core/index.py b/novelwriter/core/index.py index 4fd59a19..9b5f25db 100644 --- a/novelwriter/core/index.py +++ b/novelwriter/core/index.py @@ -396,6 +396,8 @@ class NWIndex: return "H1", line[3:].strip() elif line.startswith("##! "): return "H2", line[4:].strip() + elif line.startswith("###! "): + return "H3", line[5:].strip() return "H0", "" def _indexWordCounts(self, tHandle: str, text: str, sTitle: str) -> None: diff --git a/novelwriter/gui/doceditor.py b/novelwriter/gui/doceditor.py index ed0ba5fe..f041141b 100644 --- a/novelwriter/gui/doceditor.py +++ b/novelwriter/gui/doceditor.py @@ -1651,6 +1651,9 @@ class GuiDocEditor(QPlainTextEdit): elif text.startswith("##! "): temp = text[4:] offset = 4 + elif text.startswith("###! "): + temp = text[5:] + offset = 5 elif text.startswith(">> "): temp = text[3:] offset = 3 diff --git a/novelwriter/gui/dochighlight.py b/novelwriter/gui/dochighlight.py index 5ead13a1..6dd2322a 100644 --- a/novelwriter/gui/dochighlight.py +++ b/novelwriter/gui/dochighlight.py @@ -300,7 +300,7 @@ class GuiDocHighlighter(QSyntaxHighlighter): # so we force a return here return - elif text.startswith(("# ", "#! ", "## ", "##! ", "### ", "#### ")): + elif text.startswith(("# ", "#! ", "## ", "##! ", "### ", "###! ", "#### ")): self.setCurrentBlockState(self.BLOCK_TITLE) if text.startswith("# "): # Heading 1 @@ -327,6 +327,10 @@ class GuiDocHighlighter(QSyntaxHighlighter): self.setFormat(0, 3, self._hStyles["head2h"]) self.setFormat(3, len(text), self._hStyles["header2"]) + elif text.startswith("###! "): # Hard Scene + self.setFormat(0, 4, self._hStyles["head3h"]) + self.setFormat(4, len(text), self._hStyles["header3"]) + elif text.startswith("%"): # Comments self.setCurrentBlockState(self.BLOCK_TEXT) cStyle, _, cPos = processComment(text) diff --git a/novelwriter/text/counting.py b/novelwriter/text/counting.py index c91838b3..697cf5e8 100644 --- a/novelwriter/text/counting.py +++ b/novelwriter/text/counting.py @@ -106,6 +106,9 @@ def standardCounter(text: str) -> tuple[int, int, int]: elif line[:4] == "##! ": line = line[4:] countPara = False + elif line[:5] == "###! ": + line = line[5:] + countPara = False wCount += len(line.split()) cCount += len(line)