diff --git a/novelwriter/enum.py b/novelwriter/enum.py index 48b894ba..ecb4ea4a 100644 --- a/novelwriter/enum.py +++ b/novelwriter/enum.py @@ -112,9 +112,10 @@ class nwDocInsert(Enum): QUOTE_RS = 2 QUOTE_LD = 3 QUOTE_RD = 4 - NEW_PAGE = 5 - VSPACE_S = 6 - VSPACE_M = 7 + SYNOPSIS = 5 + NEW_PAGE = 6 + VSPACE_S = 7 + VSPACE_M = 8 # END Enum nwDocInsert diff --git a/novelwriter/gui/doceditor.py b/novelwriter/gui/doceditor.py index 9126872b..0bde6d8c 100644 --- a/novelwriter/gui/doceditor.py +++ b/novelwriter/gui/doceditor.py @@ -877,6 +877,7 @@ class GuiDocEditor(QTextEdit): return False newBlock = False + goAfter = False if isinstance(theInsert, str): theText = theInsert @@ -889,22 +890,29 @@ class GuiDocEditor(QTextEdit): theText = self._typDQOpen elif theInsert == nwDocInsert.QUOTE_RD: theText = self._typDQClose + elif theInsert == nwDocInsert.SYNOPSIS: + theText = "% Synopsis: " + newBlock = True + goAfter = True elif theInsert == nwDocInsert.NEW_PAGE: theText = "[NEW PAGE]" newBlock = True + goAfter = False elif theInsert == nwDocInsert.VSPACE_S: theText = "[VSPACE]" newBlock = True + goAfter = False elif theInsert == nwDocInsert.VSPACE_M: theText = "[VSPACE:2]" newBlock = True + goAfter = False else: return False else: return False if newBlock: - self.insertNewBlock(theText, defaultAfter=False) + self.insertNewBlock(theText, defaultAfter=goAfter) else: theCursor = self.textCursor() theCursor.beginEditBlock() diff --git a/novelwriter/gui/mainmenu.py b/novelwriter/gui/mainmenu.py index a110cb8a..8a74035e 100644 --- a/novelwriter/gui/mainmenu.py +++ b/novelwriter/gui/mainmenu.py @@ -554,6 +554,15 @@ class GuiMainMenu(QMenuBar): ) self.mInsKeywords.addAction(self.mInsKWItems[keyWord][0]) + # Insert > Special Comments + self.mInsComments = self.insertMenu.addMenu(self.tr("Special Comments")) + + # Insert > Synopsis Comment + self.aInsSynopsis = QAction(self.tr("Synopsis Comment"), self) + self.aInsSynopsis.setShortcut("Ctrl+K, S") + self.aInsSynopsis.triggered.connect(lambda: self._docInsert(nwDocInsert.SYNOPSIS)) + self.mInsComments.addAction(self.aInsSynopsis) + # Insert > Symbols self.mInsBreaks = self.insertMenu.addMenu(self.tr("Page Break and Space"))