@@ -2769,7 +2769,7 @@ pub mod cmd {
27692769
27702770 let mut fragments: Vec<_> = selection
27712771 .fragments(text)
2772− .map(|fragment| Tendril::from_slice(&fragment))
2772+ .map(|fragment| Tendril::from(fragment.as_ref()))
27732773 .collect();
27742774
27752775 fragments.sort_by(match reverse {
@@ -3921,7 +3921,7 @@ fn try_restore_indent(doc: &mut Document, view_id: ViewId) {
39213921 if let [Operation::Retain(move_pos), Operation::Insert(ref inserted_str), Operation::Retain(_)] =
39223922 changes
39233923 {
3924− move_pos + inserted_str.len32() as usize == pos
3924+ move_pos + inserted_str.len() == pos
39253925 && inserted_str.starts_with('\n')
39263926 && inserted_str.chars().skip(1).all(char_is_whitespace)
39273927 && pos == line_end_pos // ensure no characters exists after current position
@@ -4513,7 +4513,8 @@ pub mod insert {
45134513 #[allow(clippy::unnecessary_wraps)] // need to use Option<> because of the Hook signature
45144514 fn insert(doc: &Rope, selection: &Selection, ch: char) -> Option<Transaction> {
45154515 let cursors = selection.clone().cursors(doc.slice(..));
4516− let t = Tendril::from_char(ch);
4516+ let mut t = Tendril::new();
4517+ t.push(ch);
45174518 let transaction = Transaction::insert(doc, &cursors, t);
45184519 Some(transaction)
45194520 }
@@ -5015,12 +5016,12 @@ fn replace_with_yanked(cx: &mut Context) {
50155016 let repeat = std::iter::repeat(
50165017 values
50175018 .last()
5018− .map(|value| Tendril::from_slice(&value.repeat(count)))
5019+ .map(|value| Tendril::from(&value.repeat(count)))
50195020 .unwrap(),
50205021 );
50215022 let mut values = values
50225023 .iter()
5023− .map(|value| Tendril::from_slice(&value.repeat(count)))
5024+ .map(|value| Tendril::from(&value.repeat(count)))
50245025 .chain(repeat);
50255026 let selection = doc.selection(view.id);
50265027 let transaction = Transaction::change_by_selection(doc.text(), selection, |range| {
@@ -5530,7 +5531,7 @@ fn rotate_selection_contents(cx: &mut Context, direction: Direction) {
55305531 let selection = doc.selection(view.id);
55315532 let mut fragments: Vec<_> = selection
55325533 .fragments(text)
5533− .map(|fragment| Tendril::from_slice(&fragment))
5534+ .map(|fragment| Tendril::from(fragment.as_ref()))
55345535 .collect();
55355536
55365537 let group = count
@@ -5891,8 +5892,12 @@ fn surround_add(cx: &mut Context) {
58915892
58925893 let mut changes = Vec::with_capacity(selection.len() * 2);
58935894 for range in selection.iter() {
5894− changes.push((range.from(), range.from(), Some(Tendril::from_char(open))));
5895− changes.push((range.to(), range.to(), Some(Tendril::from_char(close))));
5895+ let mut o = Tendril::new();
5896+ o.push(open);
5897+ let mut c = Tendril::new();
5898+ c.push(close);
5899+ changes.push((range.from(), range.from(), Some(o)));
5900+ changes.push((range.to(), range.to(), Some(c)));
58965901 }
58975902
58985903 let transaction = Transaction::change(doc.text(), changes.into_iter());
@@ -5921,11 +5926,9 @@ fn surround_replace(cx: &mut Context) {
59215926 let transaction = Transaction::change(
59225927 doc.text(),
59235928 change_pos.iter().enumerate().map(|(i, &pos)| {
5924− (
5925− pos,
5926− pos + 1,
5927− Some(Tendril::from_char(if i % 2 == 0 { open } else { close })),
5928− )
5929+ let mut t = Tendril::new();
5930+ t.push(if i % 2 == 0 { open } else { close });
5931+ (pos, pos + 1, Some(t))
59295932 }),
59305933 );
59315934 doc.apply(&transaction, view.id);
@@ -6065,8 +6068,9 @@ fn shell_impl(
60656068 log::error!("Shell error: {}", String::from_utf8_lossy(&output.stderr));
60666069 }
60676070
6068− let tendril = Tendril::try_from_byte_slice(&output.stdout)
6071+ let str = std::str::from_utf8(&output.stdout)
60696072 .map_err(|_| anyhow!("Process did not output valid UTF-8"))?;
6073+ let tendril = Tendril::from(str);
60706074 Ok((tendril, output.status.success()))
60716075}
60726076