From ee398d4d98c6cff45f6e6184865705e6e43b96b1 Mon Sep 17 00:00:00 2001 From: Lykin <137850705+tiny-craft@users.noreply.github.com> Date: Fri, 26 Jul 2024 11:09:13 +0800 Subject: [PATCH] pref: support `Home` and `End` input for cli (#313) --- frontend/src/components/content_value/ContentCli.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontend/src/components/content_value/ContentCli.vue b/frontend/src/components/content_value/ContentCli.vue index 36976b7..620d5e6 100644 --- a/frontend/src/components/content_value/ContentCli.vue +++ b/frontend/src/components/content_value/ContentCli.vue @@ -253,6 +253,15 @@ const onTermKey = (e) => { } // block all ctrl key combinations input return false + } else { + switch (e.key) { + case 'Home': // move to head of line + moveInputCursorTo(0) + return false + case 'End': // move to tail of line + moveInputCursorTo(Number.MAX_SAFE_INTEGER) + return false + } } } return true