added a line numbers option
This commit is contained in:
@@ -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():
|
||||
|
||||
|
||||
Reference in New Issue
Block a user