minor: Extract doc.text().slice(..) into a var

imgbot
Blaž Hrastnik 3 years ago
parent 38e932bd4c
commit d4c17b633c

@ -4113,11 +4113,9 @@ fn align_view_bottom(cx: &mut Context) {
fn align_view_middle(cx: &mut Context) { fn align_view_middle(cx: &mut Context) {
let (view, doc) = current!(cx.editor); let (view, doc) = current!(cx.editor);
let pos = doc let text = doc.text().slice(..);
.selection(view.id) let pos = doc.selection(view.id).primary().cursor(text);
.primary() let pos = coords_at_pos(text, pos);
.cursor(doc.text().slice(..));
let pos = coords_at_pos(doc.text().slice(..), pos);
view.offset.col = pos view.offset.col = pos
.col .col

Loading…
Cancel
Save