]> git.scottworley.com Git - vopamoi/commitdiff
Leader key "v" for selecting views
authorScott Worley <scottworley@scottworley.com>
Thu, 27 Jan 2022 07:00:48 +0000 (23:00 -0800)
committerScott Worley <scottworley@scottworley.com>
Thu, 27 Jan 2022 20:21:55 +0000 (12:21 -0800)
vopamoi.ts

index 80e8ff93c704ad3c5bb4675a29abe3c269be3eca..4280ffcf9fde5c858cc48e1794aacd2d00719524 100644 (file)
@@ -312,6 +312,7 @@ const BrowserUI = {
 
 enum InputState {
   Command,
+  View,
 }
 var inputState = InputState.Command;
 
@@ -337,6 +338,9 @@ function handleKey(event: any) {
       if (event.key == "X") return BrowserUI.setState("deleted");
       if (event.key == "u") return BrowserUI.undo();
       if (event.key == "e") return BrowserUI.beginEdit(event);
+      if (event.key == "v") return (inputState = InputState.View);
+    } else if (inputState === InputState.View) {
+      return (inputState = InputState.Command);
     }
   }
 }