Skip to content

Commit

Permalink
dyn egui::TextBuffer instead of String
Browse files Browse the repository at this point in the history
  • Loading branch information
p4ymak committed Apr 10, 2024
1 parent 77149cb commit 0b84b35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "egui_code_editor"
authors = ["Roman Chumak <p4ymak@yandex.ru>"]
version = "0.2.6"
version = "0.2.7"
edition = "2021"
license = "MIT"
repository = "https://github.com/p4ymak/egui_code_editor"
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ impl CodeEditor {

#[cfg(feature = "egui")]
/// Show Code Editor
pub fn show(&mut self, ui: &mut egui::Ui, text: &mut String) -> TextEditOutput {
pub fn show(&mut self, ui: &mut egui::Ui, text: &mut dyn egui::TextBuffer) -> TextEditOutput {
let mut text_edit_output: Option<TextEditOutput> = None;
let mut code_editor = |ui: &mut egui::Ui| {
ui.horizontal_top(|h| {
self.theme.modify_style(h, self.fontsize);
if self.numlines {
self.numlines_show(h, text);
self.numlines_show(h, text.as_str());
}
egui::ScrollArea::horizontal()
.id_source(format!("{}_inner_scroll", self.id))
Expand Down

0 comments on commit 0b84b35

Please sign in to comment.