aboutsummaryrefslogtreecommitdiff
path: root/helix-view
diff options
context:
space:
mode:
Diffstat (limited to 'helix-view')
-rw-r--r--helix-view/src/editor.rs2
-rw-r--r--helix-view/src/info.rs15
2 files changed, 5 insertions, 12 deletions
diff --git a/helix-view/src/editor.rs b/helix-view/src/editor.rs
index 20469ae9..1824ebf7 100644
--- a/helix-view/src/editor.rs
+++ b/helix-view/src/editor.rs
@@ -5,6 +5,7 @@ use crate::{
graphics::{CursorKind, Rect},
info::Info,
input::KeyEvent,
+ register::Registers,
theme::{self, Theme},
tree::{self, Tree},
view::ViewPosition,
@@ -40,7 +41,6 @@ use tokio::{
use anyhow::{anyhow, bail, Error};
pub use helix_core::diagnostic::Severity;
-pub use helix_core::register::Registers;
use helix_core::{
auto_pairs::AutoPairs,
syntax::{self, AutoPairConfig, SoftWrap},
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);