Struct egui_code_editor::CodeEditor
source · pub struct CodeEditor { /* private fields */ }Expand description
CodeEditor struct which stores settings for highlighting.
Implementations§
source§impl CodeEditor
impl CodeEditor
pub fn id_source(self, id_source: impl Into<String>) -> Self
sourcepub fn with_theme(self, theme: ColorTheme) -> Self
pub fn with_theme(self, theme: ColorTheme) -> Self
Use custom Color Theme
Default: Gruvbox
sourcepub fn with_fontsize(self, fontsize: f32) -> Self
pub fn with_fontsize(self, fontsize: f32) -> Self
Use custom font size
Default: 10.0
sourcepub fn with_ui_fontsize(self, ui: &mut Ui) -> Self
pub fn with_ui_fontsize(self, ui: &mut Ui) -> Self
Use UI font size
sourcepub fn with_numlines(self, numlines: bool) -> Self
pub fn with_numlines(self, numlines: bool) -> Self
Show or hide lines numbering
Default: true
sourcepub fn with_syntax(self, syntax: Syntax) -> Self
pub fn with_syntax(self, syntax: Syntax) -> Self
Use custom syntax for highlighting
Default: Rust
sourcepub fn vscroll(self, vscroll: bool) -> Self
pub fn vscroll(self, vscroll: bool) -> Self
Turn on/off scrolling on the vertical axis.
Default: true
sourcepub fn auto_shrink(self, shrink: bool) -> Self
pub fn auto_shrink(self, shrink: bool) -> Self
Should the containing area shrink if the content is small?
Default: false
sourcepub fn stick_to_bottom(self, stick_to_bottom: bool) -> Self
pub fn stick_to_bottom(self, stick_to_bottom: bool) -> Self
Stick to bottom The scroll handle will stick to the bottom position even while the content size changes dynamically. This can be useful to simulate terminal UIs or log/info scrollers. The scroll handle remains stuck until user manually changes position. Once “unstuck” it will remain focused on whatever content viewport the user left it on. If the scroll handle is dragged to the bottom it will again become stuck and remain there until manually pulled from the end position.
Default: false
sourcepub fn show(&mut self, ui: &mut Ui, text: &mut String) -> TextEditOutput
pub fn show(&mut self, ui: &mut Ui, text: &mut String) -> TextEditOutput
Show Code Editor
Trait Implementations§
source§impl Clone for CodeEditor
impl Clone for CodeEditor
source§fn clone(&self) -> CodeEditor
fn clone(&self) -> CodeEditor
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for CodeEditor
impl Debug for CodeEditor
source§impl Default for CodeEditor
impl Default for CodeEditor
source§fn default() -> CodeEditor
fn default() -> CodeEditor
source§impl Hash for CodeEditor
impl Hash for CodeEditor
source§impl PartialEq for CodeEditor
impl PartialEq for CodeEditor
source§fn eq(&self, other: &CodeEditor) -> bool
fn eq(&self, other: &CodeEditor) -> bool
self and other values to be equal, and is used
by ==.