MCPcopy Create free account
hub / github.com/RIP-Comm/clementine / insert_text

Method insert_text

ui/src/cpu_handler.rs:80–90  ·  view source on GitHub ↗
(&mut self, text: &str, char_index: egui::text::CharIndex)

Source from the content-addressed store, hash-verified

78 text_string.make_ascii_uppercase();
79
80 let byte_idx = byte_index_from_char_index(self.as_str(), char_index);
81
82 self.insert_str(byte_idx.into(), text_string.as_str());
83
84 text.chars().count()
85 }
86
87 fn delete_char_range(&mut self, char_range: Range<egui::text::CharIndex>) {
88 assert!(char_range.start <= char_range.end);
89
90 // Get both byte indices
91 let byte_start = byte_index_from_char_index(self.as_str(), char_range.start);
92 let byte_end = byte_index_from_char_index(self.as_str(), char_range.end);
93

Callers

nothing calls this directly

Calls 1

as_strMethod · 0.80

Tested by

no test coverage detected