diff --git a/editor/benches/edit_benchmark.rs b/editor/benches/edit_benchmark.rs index 094a6b6321..c7d0e6242e 100644 --- a/editor/benches/edit_benchmark.rs +++ b/editor/benches/edit_benchmark.rs @@ -32,7 +32,7 @@ fn text_buffer_from_str(lines_str: &str) -> TextBuffer { TextBuffer { text_rope: Rope::from_str(lines_str), path_str: "".to_owned(), - mem_arena: Bump::new(), + arena: Bump::new(), } } diff --git a/editor/benches/file_benchmark.rs b/editor/benches/file_benchmark.rs index 2601e3b78d..1cee4781ab 100644 --- a/editor/benches/file_benchmark.rs +++ b/editor/benches/file_benchmark.rs @@ -33,7 +33,7 @@ fn text_buffer_from_str(lines_str: &str) -> TextBuffer { TextBuffer { text_rope: Rope::from_str(lines_str), path_str: "".to_owned(), - mem_arena: bumpalo::Bump::new(), + arena: bumpalo::Bump::new(), } } diff --git a/editor/editor-ideas.md b/editor/editor-ideas.md index 16bb32b4f3..d86da25b0a 100644 --- a/editor/editor-ideas.md +++ b/editor/editor-ideas.md @@ -8,6 +8,8 @@ Here are some ideas and interesting resources for the editor. Feel free to make These are potentially inspirational resources for the editor's design. +Nice collection of research on innovative editors, [link](https://futureofcoding.org/catalog/). + ### Package-specific editor integrations (Or possibly module-specific integrations, type-specific integrations, etc.) @@ -28,6 +30,7 @@ These are potentially inspirational resources for the editor's design. * [Xi](https://xi-editor.io/) modern text editor with concurrent editing (related to [Druid](https://github.com/linebender/druid)) * [Self](https://selflanguage.org/) programming language * [Primitive](https://primitive.io/) code exploration in Virtual Reality +* [Luna](https://www.luna-lang.org/) language for interactive data processing and visualization ### Debugging @@ -51,6 +54,8 @@ These are potentially inspirational resources for the editor's design. * [Blueprints](https://docs.unrealengine.com/en-US/Engine/Blueprints/index.html) visual scripting (not suggesting visual scripting for Roc) * [Live Programing](https://www.microsoft.com/en-us/research/project/live-programming/?from=http%3A%2F%2Fresearch.microsoft.com%2Fen-us%2Fprojects%2Fliveprogramming%2Ftypography.aspx#!publications) by [Microsoft Research] it contains many interesting research papers. +* [Math Inspector](https://mathinspector.com/), [github](https://github.com/MathInspector/MathInspector) +* [Lamdu](http://www.lamdu.org/) live functional programming. ### Productivity features @@ -63,6 +68,7 @@ These are potentially inspirational resources for the editor's design. * Suggest automatically creating a function if the compiler says it does not exist. * Integrated search: * Searchbar for examples/docs. With permission search strings could be shared with the platform/package authors so they know exactly what their users are struggling with. +* Webcam based eye tracking for quick selection. Could be used to select from autocomplete options instead of having to use arrows. ### Non-Code Related Inspiration diff --git a/editor/src/lib.rs b/editor/src/lib.rs index 74d9fbaf38..882bdb7116 100644 --- a/editor/src/lib.rs +++ b/editor/src/lib.rs @@ -167,8 +167,11 @@ fn run_event_loop(file_path_opt: Option<&Path>) -> Result<(), Box> { let mut keyboard_modifiers = ModifiersState::empty(); + // This arena is never cleared and should only be used for allocations that occur rarely let arena = Bump::new(); + let mut rects_arena = Bump::new(); + // Render loop window.request_redraw(); @@ -317,9 +320,11 @@ fn run_event_loop(file_path_opt: Option<&Path>) -> Result<(), Box> { ); } + rects_arena.reset(); + match draw_all_rects( &app_model.ed_model_opt, - &arena, + &rects_arena, &mut encoder, &frame.view, &gpu_device, diff --git a/editor/src/selection.rs b/editor/src/selection.rs index f0bedab2ce..c3281dd7a9 100644 --- a/editor/src/selection.rs +++ b/editor/src/selection.rs @@ -216,7 +216,7 @@ pub mod test_selection { TextBuffer { text_rope: Rope::from_str(lines_str), path_str: "".to_owned(), - mem_arena: bumpalo::Bump::new(), + arena: bumpalo::Bump::new(), } } diff --git a/editor/src/text_buffer.rs b/editor/src/text_buffer.rs index c714ece8a6..f43d0260ff 100644 --- a/editor/src/text_buffer.rs +++ b/editor/src/text_buffer.rs @@ -17,7 +17,7 @@ use std::path::Path; pub struct TextBuffer { pub text_rope: Rope, pub path_str: String, - pub mem_arena: Bump, + pub arena: Bump, } impl TextBuffer { @@ -65,7 +65,7 @@ impl TextBuffer { } else { // happens very rarely let line_str = rope_slice.chunks().collect::(); - let arena_str_ref = self.mem_arena.alloc(line_str); + let arena_str_ref = self.arena.alloc(line_str); Ok(arena_str_ref) } } @@ -92,7 +92,7 @@ impl TextBuffer { } else { // happens very rarely let line_str = rope_slice.chunks().collect::(); - let arena_str_ref = self.mem_arena.alloc(line_str); + let arena_str_ref = self.arena.alloc(line_str); Some(arena_str_ref) } } else { @@ -144,12 +144,12 @@ impl TextBuffer { pub fn from_path(path: &Path) -> EdResult { let text_rope = rope_from_path(path)?; let path_str = path_to_string(path); - let mem_arena = Bump::new(); + let arena = Bump::new(); Ok(TextBuffer { text_rope, path_str, - mem_arena, + arena, }) }