added a line numbers option

This commit is contained in:
SpookyDervish
2025-10-31 07:34:52 +11:00
parent ff3137419a
commit 084d7b4dff
3 changed files with 18 additions and 2 deletions

View File

@@ -73,6 +73,9 @@ class SettingsScreen(ModalScreen):
if event.switch.id == "word-wrap":
self.app.query_one("#code-editor").soft_wrap = event.value
self.app.config_handler.set("editor", "word_wrap", str(int(event.value)))
elif event.switch.id == "line-numbers":
self.app.query_one("#code-editor").show_line_numbers = event.value
self.app.config_handler.set("editor", "line_numbers", str(int(event.value)))
elif event.switch.id == "plugins-enabled":
self.app.config_handler.set("plugins", "enabled", str(int(event.value)))
self.notify("Restart for changes to apply.", title="Restart Required", severity="warning")
@@ -122,6 +125,12 @@ class SettingsScreen(ModalScreen):
yield Label("Word Wrap", classes="setting-name")
yield Label("Enable word wrap in the code editor.", classes="setting-desc")
yield Switch(value=bool(int(self.app.config_handler.get("editor", "word_wrap"))), id="word-wrap")
with HorizontalGroup(classes="setting"):
with VerticalGroup():
yield Label("Line Numbers", classes="setting-name")
yield Label("Show line numbers in the editor.", classes="setting-desc")
yield Switch(value=bool(int(self.app.config_handler.get("editor", "line_numbers"))), id="line-numbers")
with TabPane("Plugins"):
with VerticalScroll():