From 792b8a180ea729fd3cbfffaa915c6df9041e391d Mon Sep 17 00:00:00 2001
From: Scott Worley <scottworley@scottworley.com>
Date: Thu, 27 Jan 2022 21:59:47 -0800
Subject: [PATCH] Factor out makeTopPriority

---
 vopamoi.ts | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vopamoi.ts b/vopamoi.ts
index fe97410..ede5911 100644
--- a/vopamoi.ts
+++ b/vopamoi.ts
@@ -262,7 +262,7 @@ function BrowserUI() {
       }
       input.value = "";
       if (event.getModifierState("Control")) {
-        this.setPriority(task, null, document.getElementsByClassName("task")[0]);
+        this.makeTopPriority(task);
       }
     },
 
@@ -356,6 +356,10 @@ function BrowserUI() {
       return valid_cursor;
     },
 
+    makeTopPriority: function (task: Element) {
+      this.setPriority(task, null, document.getElementsByClassName("task")[0]);
+    },
+
     moveCursor: function (offset: number): boolean {
       const active = document.activeElement;
       if (!active) return false;
-- 
2.47.2