pub struct EditorConfig {
pub show_line_numbers: bool,
pub wrap_mode: bool,
pub tab_width: usize,
pub theme: String,
}Expand description
編輯器配置選項
用於自訂編輯器的顯示和行為設定。
§範例
use wedi_widget::EditorConfig;
let config = EditorConfig::new()
.with_line_numbers(true)
.with_wrap_mode(true)
.with_tab_width(4)
.with_theme("base16-ocean.dark".to_string());Fields§
§show_line_numbers: bool是否顯示行號
wrap_mode: bool是否啟用自動換行(true=多行換行, false=單行水平滾動)
tab_width: usizeTab 鍵寬度(空格數)
theme: String語法高亮主題名稱
Implementations§
Source§impl EditorConfig
impl EditorConfig
Sourcepub fn with_line_numbers(self, show: bool) -> Self
pub fn with_line_numbers(self, show: bool) -> Self
Sourcepub fn with_wrap_mode(self, wrap: bool) -> Self
pub fn with_wrap_mode(self, wrap: bool) -> Self
Sourcepub fn with_tab_width(self, width: usize) -> Self
pub fn with_tab_width(self, width: usize) -> Self
Sourcepub fn with_theme(self, theme: String) -> Self
pub fn with_theme(self, theme: String) -> Self
Trait Implementations§
Source§impl Clone for EditorConfig
impl Clone for EditorConfig
Source§fn clone(&self) -> EditorConfig
fn clone(&self) -> EditorConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EditorConfig
impl Debug for EditorConfig
Auto Trait Implementations§
impl Freeze for EditorConfig
impl RefUnwindSafe for EditorConfig
impl Send for EditorConfig
impl Sync for EditorConfig
impl Unpin for EditorConfig
impl UnwindSafe for EditorConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more