mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-12-18 23:34:19 +01:00
Default editor condition on Darwin
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import nomadnet
|
import nomadnet
|
||||||
import urwid
|
import urwid
|
||||||
|
import platform
|
||||||
|
|
||||||
class ConfigDisplayShortcuts():
|
class ConfigDisplayShortcuts():
|
||||||
def __init__(self, app):
|
def __init__(self, app):
|
||||||
@@ -50,6 +51,12 @@ class EditorTerminal(urwid.WidgetWrap):
|
|||||||
self.app = app
|
self.app = app
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
editor_cmd = self.app.config["textui"]["editor"]
|
editor_cmd = self.app.config["textui"]["editor"]
|
||||||
|
|
||||||
|
# The "editor" alias is unavailable on Darwin,
|
||||||
|
# so we replace it with nano.
|
||||||
|
if platform.system() == "Darwin" and editor_cmd == "editor":
|
||||||
|
editor_cmd = "nano"
|
||||||
|
|
||||||
self.term = urwid.Terminal(
|
self.term = urwid.Terminal(
|
||||||
(editor_cmd, self.app.configpath),
|
(editor_cmd, self.app.configpath),
|
||||||
encoding='utf-8',
|
encoding='utf-8',
|
||||||
|
|||||||
Reference in New Issue
Block a user