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_numlines_shift(self, numlines_shift: isize) -> Self
pub fn with_numlines_shift(self, numlines_shift: isize) -> Self
Shift lines numbering by this value
Default: 0
Sourcepub fn with_numlines_only_natural(self, numlines_only_natural: bool) -> Self
pub fn with_numlines_only_natural(self, numlines_only_natural: bool) -> Self
Show lines numbering only above zero, useful for enabling numbering since nth row
Default: false
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 desired_width(self, width: f32) -> Self
pub fn desired_width(self, width: f32) -> Self
Sets the desired width of the code editor
Default: f32::INFINITY
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
pub fn format(&self, ty: TokenType) -> TextFormat
Sourcepub fn show(&mut self, ui: &mut Ui, text: &mut dyn TextBuffer) -> TextEditOutput
pub fn show(&mut self, ui: &mut Ui, text: &mut dyn TextBuffer) -> 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 more