diff --git a/ReText/__init__.py b/ReText/__init__.py index 273ea098..963ab3b3 100644 --- a/ReText/__init__.py +++ b/ReText/__init__.py @@ -81,6 +81,7 @@ def getBundledIcon(iconName): 'markdownDefaultFileExtension': '.mkd', 'openLastFilesOnStartup': False, 'pygmentsStyle': 'default', + 'recentDocumentsCount': 10, 'relativeLineNumbers': False, 'restDefaultFileExtension': '.rst', 'rightMargin': 0, diff --git a/ReText/config.py b/ReText/config.py index 367f8854..8abd8d4c 100644 --- a/ReText/config.py +++ b/ReText/config.py @@ -86,6 +86,7 @@ def initConfigOptions(self): (self.tr('Behavior'), ( (self.tr('Automatically save documents'), 'autoSave'), (self.tr('Automatically open last documents on startup'), 'openLastFilesOnStartup'), + (self.tr('Number of recent documents'), 'recentDocumentsCount'), (self.tr('Restore window geometry'), 'saveWindowGeometry'), (self.tr('Use live preview by default'), 'livePreviewByDefault'), (self.tr('Open external links in ReText window'), 'handleWebLinks'), @@ -157,6 +158,8 @@ def getPageWidget(self, options): self.configurators[name] = QSpinBox(self) if name == 'tabWidth': self.configurators[name].setRange(1, 10) + elif name == 'recentDocumentsCount': + self.configurators[name].setRange(5, 20) else: self.configurators[name].setMaximum(200) self.configurators[name].setValue(value) diff --git a/ReText/window.py b/ReText/window.py index c38565e0..5795da93 100644 --- a/ReText/window.py +++ b/ReText/window.py @@ -701,8 +701,9 @@ def moveToTopOfRecentFileList(self, fileName): if fileName in files: files.remove(fileName) files.insert(0, fileName) - if len(files) > 10: - del files[10:] + recentCount = globalSettings.recentDocumentsCount + if len(files) > recentCount: + del files[recentCount:] writeListToSettings("recentFileList", files) def createNew(self, text=None): diff --git a/configuration.md b/configuration.md index 47f3ebed..5a1fb2d7 100644 --- a/configuration.md +++ b/configuration.md @@ -28,6 +28,7 @@ option name | type | description `openLastFilesOnStartup` | boolean | whether to automatically open last documents on startup (default: false) `paperSize` | string | name of default page size to use for print and export (e.g. A4, Letter) `pygmentsStyle` | string | name of Pygments syntax highlighting style to use (default: `default`) +`recentDocumentsCount` | integer | number of recent files to show in the menu (default: 10) `relativeLineNumbers` | boolean | whether to show line numbers as relative from the current line (default: false) `restDefaultFileExtension` | string | default file extension for reStructuredText files (default: `.rst`) `rightMargin` | integer | enable drawing of vertical line on defined position (or 0 to disable)