aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/commands.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 9ec2c336..d7d50109 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -4113,11 +4113,9 @@ fn align_view_bottom(cx: &mut Context) {
fn align_view_middle(cx: &mut Context) {
let (view, doc) = current!(cx.editor);
- let pos = doc
- .selection(view.id)
- .primary()
- .cursor(doc.text().slice(..));
- let pos = coords_at_pos(doc.text().slice(..), pos);
+ let text = doc.text().slice(..);
+ let pos = doc.selection(view.id).primary().cursor(text);
+ let pos = coords_at_pos(text, pos);
view.offset.col = pos
.col