Struct TextEditor

Source
pub struct TextEditor {
Show 75 fields pub view: ScrollView, pub view_layout: Layout, pub bg: Quad, pub gutter_bg: Quad, pub cursor: Quad, pub selection: Quad, pub token_highlight: Quad, pub cursor_row: Quad, pub paren_pair: Quad, pub indent_lines: Quad, pub shadow: ScrollShadow, pub message_marker: Quad, pub text: Text, pub line_number_text: Text, pub cursors: TextCursorSet, pub open_font_scale: f32, pub folded_font_scale: f32, pub line_number_width: f32, pub line_number_click_margin: f32, pub draw_line_numbers: bool, pub top_padding: f32, pub cursor_blink_speed: f64, pub _undo_id: u64, pub highlight_area_on: bool, pub mark_unmatched_parens: bool, pub draw_cursor_row: bool, pub folding_depth: usize, pub colors: CodeEditorColors, pub read_only: bool, pub multiline: bool, pub _scroll_pos_on_load: Option<Vec2>, pub _jump_to_offset: bool, pub _view_area: Area, pub _highlight_area: Area, pub _text_inst: Option<AlignedInstance>, pub _line_number_inst: Option<AlignedInstance>, pub _line_number_chunk: Vec<char>, pub _text_area: Area, pub _scroll_pos: Vec2, pub _last_finger_move: Option<Vec2>, pub _paren_stack: Vec<ParenItem>, pub _indent_stack: Vec<(Color, f32)>, pub _indent_id_alloc: f32, pub _indent_line_inst: Option<InstanceArea>, pub _bg_inst: Option<InstanceArea>, pub _last_indent_color: Color, pub _line_geometry: Vec<LineGeom>, pub _anim_select: Vec<AnimSelect>, pub _visible_lines: usize, pub _select_scroll: Option<SelectScroll>, pub _grid_select_corner: Option<TextPos>, pub _is_row_select: bool, pub _line_chunk: Vec<(f32, char)>, pub _highlight_selection: Vec<char>, pub _highlight_token: Vec<char>, pub _last_cursor_pos: TextPos, pub _anim_font_scale: f32, pub _line_largest_font: f32, pub _anim_folding: AnimFolding, pub _monospace_size: Vec2, pub _monospace_base: Vec2, pub _tokens_on_line: usize, pub _line_was_folded: bool, pub _final_fill_height: f32, pub _draw_cursors: DrawCursors, pub _draw_search: DrawCursors, pub _draw_messages: DrawCursors, pub _cursor_blink_timer: Timer, pub _cursor_blink_flipflop: f32, pub _cursor_area: Area, pub _highlight_visibility: f32, pub _last_tabs: usize, pub _newline_tabs: usize, pub _jump_to_offset_id: u64, pub _last_lag_mutation_id: u64,
}

Fields§

§view: ScrollView§view_layout: Layout§bg: Quad§gutter_bg: Quad§cursor: Quad§selection: Quad§token_highlight: Quad§cursor_row: Quad§paren_pair: Quad§indent_lines: Quad§shadow: ScrollShadow§message_marker: Quad§text: Text§line_number_text: Text§cursors: TextCursorSet§open_font_scale: f32§folded_font_scale: f32§line_number_width: f32§line_number_click_margin: f32§draw_line_numbers: bool§top_padding: f32§cursor_blink_speed: f64§_undo_id: u64§highlight_area_on: bool§mark_unmatched_parens: bool§draw_cursor_row: bool§folding_depth: usize§colors: CodeEditorColors§read_only: bool§multiline: bool§_scroll_pos_on_load: Option<Vec2>§_jump_to_offset: bool§_view_area: Area§_highlight_area: Area§_text_inst: Option<AlignedInstance>§_line_number_inst: Option<AlignedInstance>§_line_number_chunk: Vec<char>§_text_area: Area§_scroll_pos: Vec2§_last_finger_move: Option<Vec2>§_paren_stack: Vec<ParenItem>§_indent_stack: Vec<(Color, f32)>§_indent_id_alloc: f32§_indent_line_inst: Option<InstanceArea>§_bg_inst: Option<InstanceArea>§_last_indent_color: Color§_line_geometry: Vec<LineGeom>§_anim_select: Vec<AnimSelect>§_visible_lines: usize§_select_scroll: Option<SelectScroll>§_grid_select_corner: Option<TextPos>§_is_row_select: bool§_line_chunk: Vec<(f32, char)>§_highlight_selection: Vec<char>§_highlight_token: Vec<char>§_last_cursor_pos: TextPos§_anim_font_scale: f32§_line_largest_font: f32§_anim_folding: AnimFolding§_monospace_size: Vec2§_monospace_base: Vec2§_tokens_on_line: usize§_line_was_folded: bool§_final_fill_height: f32§_draw_cursors: DrawCursors§_draw_search: DrawCursors§_draw_messages: DrawCursors§_cursor_blink_timer: Timer§_cursor_blink_flipflop: f32§_cursor_area: Area§_highlight_visibility: f32§_last_tabs: usize§_newline_tabs: usize§_jump_to_offset_id: u64§_last_lag_mutation_id: u64

Implementations§

Source§

impl TextEditor

Source

pub fn proto(cx: &mut Cx) -> Self

Source

pub fn gutter_width() -> FloatId

Source

pub fn padding_top() -> FloatId

Source

pub fn shadow_size() -> FloatId

Source

pub fn layout_bg() -> LayoutId

Source

pub fn text_style_editor_text() -> TextStyleId

Source

pub fn color_bg() -> ColorId

Source

pub fn color_gutter_bg() -> ColorId

Source

pub fn color_selection() -> ColorId

Source

pub fn color_selection_defocus() -> ColorId

Source

pub fn color_highlight() -> ColorId

Source

pub fn color_cursor() -> ColorId

Source

pub fn color_cursor_row() -> ColorId

Source

pub fn color_indent_line_unknown() -> ColorId

Source

pub fn color_indent_line_fn() -> ColorId

Source

pub fn color_indent_line_typedef() -> ColorId

Source

pub fn color_indent_line_looping() -> ColorId

Source

pub fn color_indent_line_flow() -> ColorId

Source

pub fn color_paren_pair_match() -> ColorId

Source

pub fn color_paren_pair_fail() -> ColorId

Source

pub fn color_marker_error() -> ColorId

Source

pub fn color_marker_warning() -> ColorId

Source

pub fn color_marker_log() -> ColorId

Source

pub fn color_line_number_normal() -> ColorId

Source

pub fn color_line_number_highlight() -> ColorId

Source

pub fn color_whitespace() -> ColorId

Source

pub fn color_keyword() -> ColorId

Source

pub fn color_flow() -> ColorId

Source

pub fn color_looping() -> ColorId

Source

pub fn color_identifier() -> ColorId

Source

pub fn color_call() -> ColorId

Source

pub fn color_type_name() -> ColorId

Source

pub fn color_theme_name() -> ColorId

Source

pub fn color_string() -> ColorId

Source

pub fn color_number() -> ColorId

Source

pub fn color_comment() -> ColorId

Source

pub fn color_doc_comment() -> ColorId

Source

pub fn color_paren_d1() -> ColorId

Source

pub fn color_paren_d2() -> ColorId

Source

pub fn color_operator() -> ColorId

Source

pub fn color_delimiter() -> ColorId

Source

pub fn color_unexpected() -> ColorId

Source

pub fn color_warning() -> ColorId

Source

pub fn color_error() -> ColorId

Source

pub fn color_defocus() -> ColorId

Source

pub fn shader_bg() -> ShaderId

Source

pub fn shader_indent_lines() -> ShaderId

Source

pub fn shader_cursor() -> ShaderId

Source

pub fn shader_selection() -> ShaderId

Source

pub fn shader_paren_pair() -> ShaderId

Source

pub fn shader_cursor_row() -> ShaderId

Source

pub fn shader_token_highlight() -> ShaderId

Source

pub fn shader_message_marker() -> ShaderId

Source

pub fn instance_indent_id() -> InstanceFloat

Source

pub fn uniform_indent_sel() -> UniformFloat

Source

pub fn instance_select_prev_x() -> InstanceFloat

Source

pub fn instance_select_prev_w() -> InstanceFloat

Source

pub fn instance_select_next_x() -> InstanceFloat

Source

pub fn instance_select_next_w() -> InstanceFloat

Source

pub fn uniform_highlight_visible() -> UniformFloat

Source

pub fn instance_shadow_dir() -> InstanceFloat

Source

pub fn style(cx: &mut Cx, _opt: &StyleOptions)

Source

pub fn apply_style(&mut self, cx: &mut Cx)

Source

pub fn handle_text_editor( &mut self, cx: &mut Cx, event: &mut Event, text_buffer: &mut TextBuffer, ) -> TextEditorEvent

Source

pub fn has_key_focus(&self, cx: &Cx) -> bool

Source

pub fn set_key_focus(&mut self, cx: &mut Cx)

Source

pub fn begin_text_editor( &mut self, cx: &mut Cx, text_buffer: &TextBuffer, ) -> Result<(), ()>

Source

pub fn draw_chunk( &mut self, cx: &mut Cx, token_chunks_index: usize, flat_text: &Vec<char>, token_chunk: &TokenChunk, message_cursors: &Vec<TextCursor>, )

Source

pub fn end_text_editor(&mut self, cx: &mut Cx, text_buffer: &TextBuffer)

Trait Implementations§

Source§

impl Clone for TextEditor

Source§

fn clone(&self) -> TextEditor

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.