From 073efe48f946e6c890aa449628b28b169fca0023 Mon Sep 17 00:00:00 2001
From: Michael Davis <mcarsondavis@gmail.com>
Date: Sat, 28 Dec 2024 21:40:57 -0500
Subject: [PATCH] minor: Setup default keymap directly in xtask docgen

Instantiating EditorView is a lot of machinery which is unnecessary:
the default keymap is exposed through the `default` function in the
keymap module.
---
 helix-term/src/ui/editor.rs | 6 ------
 xtask/src/docgen.rs         | 3 +--
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 5ac401bf7..5d028415e 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -57,12 +57,6 @@ pub enum InsertEvent {
     RequestCompletion,
 }
 
-impl Default for EditorView {
-    fn default() -> Self {
-        Self::new(Keymaps::default())
-    }
-}
-
 impl EditorView {
     pub fn new(keymaps: Keymaps) -> Self {
         Self {
diff --git a/xtask/src/docgen.rs b/xtask/src/docgen.rs
index 6b9ebfa3d..2b58e7329 100644
--- a/xtask/src/docgen.rs
+++ b/xtask/src/docgen.rs
@@ -5,7 +5,6 @@ use crate::DynError;
 use helix_term::commands::MappableCommand;
 use helix_term::commands::TYPABLE_COMMAND_LIST;
 use helix_term::health::TsFeature;
-use helix_term::ui::EditorView;
 use helix_view::document::Mode;
 
 use std::collections::HashSet;
@@ -56,7 +55,7 @@ pub fn typable_commands() -> Result<String, DynError> {
 
 pub fn static_commands() -> Result<String, DynError> {
     let mut md = String::new();
-    let keymap = EditorView::default().keymaps.map();
+    let keymap = helix_term::keymap::default();
     let keymaps = [
         ("normal", keymap[&Mode::Normal].reverse_map()),
         ("select", keymap[&Mode::Select].reverse_map()),