From 9c5752cbac2450388ff4c94dfa82b389b3746a9c Mon Sep 17 00:00:00 2001
From: gbaranski <root@gbaranski.com>
Date: Mon, 30 Aug 2021 20:49:17 +0200
Subject: [PATCH] fix: use .cursor() instead of .head

---
 helix-term/src/ui/editor.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs
index 2c34ae96..4b9c56e7 100644
--- a/helix-term/src/ui/editor.rs
+++ b/helix-term/src/ui/editor.rs
@@ -427,7 +427,7 @@ impl EditorView {
 
         let current_line = doc
             .text()
-            .char_to_line(doc.selection(view.id).primary().head);
+            .char_to_line(doc.selection(view.id).primary().cursor(text));
 
         // it's used inside an iterator so the collect isn't needless:
         // https://github.com/rust-lang/rust-clippy/issues/6164