From f41688d960ef89c29c4a51c872b8406fb8f81a85 Mon Sep 17 00:00:00 2001
From: Blaž Hrastnik
Date: Sun, 20 Jun 2021 23:37:11 +0900
Subject: Merge `x` and `X`

---
 helix-term/src/commands.rs | 15 ---------------
 helix-term/src/keymap.rs   |  4 +---
 2 files changed, 1 insertion(+), 18 deletions(-)

(limited to 'helix-term')

diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 8c290979..8b6e2d88 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -888,21 +888,6 @@ fn search_selection(cx: &mut Context) {
 
 //
 
-fn select_line(cx: &mut Context) {
-    let count = cx.count();
-    let (view, doc) = current!(cx.editor);
-
-    let pos = doc.selection(view.id).primary();
-    let text = doc.text();
-
-    let line = text.char_to_line(pos.head);
-    let start = text.line_to_char(line);
-    let end = text
-        .line_to_char(std::cmp::min(doc.text().len_lines(), line + count))
-        .saturating_sub(1);
-
-    doc.set_selection(view.id, Selection::single(start, end));
-}
 fn extend_line(cx: &mut Context) {
     let count = cx.count();
     let (view, doc) = current!(cx.editor);
diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs
index 8ea9b387..46d495c3 100644
--- a/helix-term/src/keymap.rs
+++ b/helix-term/src/keymap.rs
@@ -196,9 +196,7 @@ impl Default for Keymaps {
             key!(';') => Command::collapse_selection,
             alt!(';') => Command::flip_selections,
             key!('%') => Command::select_all,
-            key!('x') => Command::select_line,
-            key!('X') => Command::extend_line,
-            // or select mode X?
+            key!('x') => Command::extend_line,
             // extend_to_whole_line, crop_to_whole_line
 
 
-- 
cgit v1.2.3-70-g09d2