From e76e068953b56dd964c95d249a5e7f1d015b3269 Mon Sep 17 00:00:00 2001 From: Zed Date: Fri, 13 Sep 2019 11:04:57 +0200 Subject: [PATCH] Preserve preference list order --- src/prefs_impl.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/prefs_impl.nim b/src/prefs_impl.nim index 011527b..d77e8b9 100644 --- a/src/prefs_impl.nim +++ b/src/prefs_impl.nim @@ -20,7 +20,7 @@ type placeholder*: string # TODO: write DSL to simplify this -const prefList*: Table[string, seq[Pref]] = { +const prefList*: OrderedTable[string, seq[Pref]] = { "Privacy": @[ Pref(kind: input, name: "replaceTwitter", label: "Replace Twitter links with Nitter (blank to disable)", @@ -33,8 +33,8 @@ const prefList*: Table[string, seq[Pref]] = { "Media": @[ Pref(kind: checkbox, name: "mp4Playback", - label: "Enable mp4 video playback", - defaultState: true), + label: "Enable mp4 video playback", + defaultState: true), Pref(kind: checkbox, name: "hlsPlayback", label: "Enable hls video streaming (requires JavaScript)", @@ -64,7 +64,7 @@ const prefList*: Table[string, seq[Pref]] = { label: "Make profile sidebar stick to top", defaultState: true) ] -}.toTable +}.toOrderedTable iterator allPrefs*(): Pref = for k, v in prefList: