aboutsummaryrefslogtreecommitdiff
path: root/helix-view/src/info.rs
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view/src/info.rs')
-rw-r--r--helix-view/src/info.rs15
1 files changed, 4 insertions, 11 deletions
diff --git a/helix-view/src/info.rs b/helix-view/src/info.rs
index 1503e855..ca783fef 100644
--- a/helix-view/src/info.rs
+++ b/helix-view/src/info.rs
@@ -1,4 +1,5 @@
-use helix_core::{register::Registers, unicode::width::UnicodeWidthStr};
+use crate::register::Registers;
+use helix_core::unicode::width::UnicodeWidthStr;
use std::fmt::Write;
#[derive(Debug)]
@@ -56,16 +57,8 @@ impl Info {
pub fn from_registers(registers: &Registers) -> Self {
let body: Vec<_> = registers
- .inner()
- .iter()
- .map(|(ch, reg)| {
- let content = reg
- .read()
- .get(0)
- .and_then(|s| s.lines().next())
- .unwrap_or_default();
- (ch.to_string(), content)
- })
+ .iter_preview()
+ .map(|(ch, preview)| (ch.to_string(), preview))
.collect();
let mut infobox = Self::new("Registers", &body);