From: Scott Worley Date: Fri, 28 Jan 2022 06:24:42 +0000 (-0800) Subject: "sm" and "vsm" for someday-*maybe*, rather than just "s" X-Git-Url: http://git.scottworley.com/vopamoi/commitdiff_plain/36ddfad1a14ce3bf0e47114933941166c56e65a7?ds=inline "sm" and "vsm" for someday-*maybe*, rather than just "s" The "maybe" in "someday-maybe" feels really important. It feels importantly different than "someday". It definitely feels worth the extra keystrokes & extra keystroke state logic. --- diff --git a/vopamoi.ts b/vopamoi.ts index 50b25fa..5b1ce6b 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -452,7 +452,9 @@ const browserUI = BrowserUI(); enum InputState { Root, + S, V, + VS, } var inputState = InputState.Root; @@ -479,7 +481,7 @@ function handleKey(event: any) { if (event.key == "c") return browserUI.setState("cancelled"); if (event.key == "d") return browserUI.setState("done"); if (event.key == "q") return browserUI.setState("todo"); - if (event.key == "s") return browserUI.setState("someday-maybe"); + if (event.key == "s") return (inputState = InputState.S); if (event.key == "w") return browserUI.setState("waiting"); if (event.key == "X") return browserUI.setState("deleted"); if (event.key == "x") return browserUI.removeTag(); @@ -487,15 +489,21 @@ function handleKey(event: any) { if (event.key == "e") return browserUI.beginEdit(event); if (event.key == "t") return browserUI.beginTagEdit(event); if (event.key == "v") return (inputState = InputState.V); + } else if (inputState === InputState.S) { + inputState = InputState.Root; + if (event.key == "m") return browserUI.setState("someday-maybe"); } else if (inputState === InputState.V) { inputState = InputState.Root; if (event.key == "c") return browserUI.setView("cancelled", "Red"); if (event.key == "d") return browserUI.setView("done", "LawnGreen"); if (event.key == "q") return browserUI.setView("todo", "White"); - if (event.key == "s") return browserUI.setView("someday-maybe", "DeepSkyBlue"); + if (event.key == "s") return (inputState = InputState.VS); if (event.key == "v") return browserUI.setView("todo", "White"); if (event.key == "w") return browserUI.setView("waiting", "MediumOrchid"); if (event.key == "x") return browserUI.setView("deleted", "Black"); + } else if (inputState === InputState.VS) { + inputState = InputState.Root; + if (event.key == "m") return browserUI.setView("someday-maybe", "DeepSkyBlue"); } } }