aboutsummaryrefslogtreecommitdiff
path: root/crates/text_edit
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-11-13 19:25:45 +0000
committerKirill Bulatov <[email protected]>2020-11-16 19:19:06 +0000
commit1598740292c29613ef2b384a82de3a2735bc5566 (patch)
treebc2451b9fe6cf7943fcbcaaa762c9591c0bad9c6 /crates/text_edit
parent4c8edd003aa447bd2da10fd81b24f582deacdc11 (diff)
Reuse existing element rendering
Diffstat (limited to 'crates/text_edit')
-rw-r--r--crates/text_edit/src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/text_edit/src/lib.rs b/crates/text_edit/src/lib.rs
index eb3c8caa2..9eef7a890 100644
--- a/crates/text_edit/src/lib.rs
+++ b/crates/text_edit/src/lib.rs
@@ -48,6 +48,10 @@ impl TextEdit {
48 TextEditBuilder::default() 48 TextEditBuilder::default()
49 } 49 }
50 50
51 pub fn into_builder(self) -> TextEditBuilder {
52 TextEditBuilder { indels: self.indels }
53 }
54
51 pub fn insert(offset: TextSize, text: String) -> TextEdit { 55 pub fn insert(offset: TextSize, text: String) -> TextEdit {
52 let mut builder = TextEdit::builder(); 56 let mut builder = TextEdit::builder();
53 builder.insert(offset, text); 57 builder.insert(offset, text);