diff options
author | Kirill Bulatov <[email protected]> | 2020-11-13 19:25:45 +0000 |
---|---|---|
committer | Kirill Bulatov <[email protected]> | 2020-11-16 19:19:06 +0000 |
commit | 1598740292c29613ef2b384a82de3a2735bc5566 (patch) | |
tree | bc2451b9fe6cf7943fcbcaaa762c9591c0bad9c6 /crates/text_edit/src | |
parent | 4c8edd003aa447bd2da10fd81b24f582deacdc11 (diff) |
Reuse existing element rendering
Diffstat (limited to 'crates/text_edit/src')
-rw-r--r-- | crates/text_edit/src/lib.rs | 4 |
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); |