aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-05-17 14:01:45 +0000
committerBlaž Hrastnik2021-05-17 14:01:45 +0000
commit2100f5a2c07cd58e05b11d124d56e15fe23685d0 (patch)
tree03d52ffefbef05bad75fe026106e3d545947a1fe /helix-view/src
parent8f6f3290573649e3ca8cadda3541fdda45587f23 (diff)
Address clippy lint.
Diffstat (limited to 'helix-view/src')
-rw-r--r--helix-view/src/editor.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index cf4dce28..e9f8b5a1 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -85,7 +85,10 @@ impl Editor {
let (view, doc) = self.current();
// initialize selection for view
- let selection = doc.selections.entry(view.id).or_insert(Selection::point(0));
+ let selection = doc
+ .selections
+ .entry(view.id)
+ .or_insert_with(|| Selection::point(0));
// TODO: reuse align_view
let pos = selection.cursor();
let line = doc.text().char_to_line(pos);