Struct editor2::Editor

source ·
pub struct Editor {
    pub selections: SelectionsCollection,
    pub scroll_manager: ScrollManager,
    pub show_local_selections: bool,
    /* private fields */
}

Fields§

§selections: SelectionsCollection§scroll_manager: ScrollManager§show_local_selections: bool

Implementations§

source§

impl Editor

source

pub fn next_screen(&mut self, _: &NextScreen, cx: &mut ViewContext<'_, Editor>)

source

pub fn scroll( &mut self, scroll_position: Point<f32>, axis: Option<Axis>, cx: &mut ViewContext<'_, Self> )

source

pub fn scroll_cursor_top( &mut self, _: &ScrollCursorTop, cx: &mut ViewContext<'_, Editor> )

source

pub fn scroll_cursor_center( &mut self, _: &ScrollCursorCenter, cx: &mut ViewContext<'_, Editor> )

source

pub fn scroll_cursor_bottom( &mut self, _: &ScrollCursorBottom, cx: &mut ViewContext<'_, Editor> )

source§

impl Editor

source

pub fn autoscroll_vertically( &mut self, viewport_height: Pixels, line_height: Pixels, cx: &mut ViewContext<'_, Editor> ) -> bool

source

pub fn autoscroll_horizontally( &mut self, start_row: u32, viewport_width: Pixels, scroll_width: Pixels, max_glyph_width: Pixels, layouts: &[LineWithInvisibles], cx: &mut ViewContext<'_, Self> ) -> bool

source

pub fn request_autoscroll( &mut self, autoscroll: Autoscroll, cx: &mut ViewContext<'_, Self> )

source§

impl Editor

source

pub fn vertical_scroll_margin(&mut self) -> usize

source

pub fn set_vertical_scroll_margin( &mut self, margin_rows: usize, cx: &mut ViewContext<'_, Self> )

source

pub fn visible_line_count(&self) -> Option<f32>

source

pub fn set_scroll_position( &mut self, scroll_position: Point<f32>, cx: &mut ViewContext<'_, Self> )

source

pub fn scroll_position(&self, cx: &mut ViewContext<'_, Self>) -> Point<f32>

source

pub fn set_scroll_anchor( &mut self, scroll_anchor: ScrollAnchor, cx: &mut ViewContext<'_, Self> )

source

pub fn scroll_screen( &mut self, amount: &ScrollAmount, cx: &mut ViewContext<'_, Self> )

source

pub fn newest_selection_on_screen(&self, cx: &mut AppContext) -> Ordering

Returns an ordering. The newest selection is: Ordering::Equal => on screen Ordering::Less => above the screen Ordering::Greater => below the screen

source

pub fn read_scroll_position_from_db( &mut self, item_id: u64, workspace_id: WorkspaceId, cx: &mut ViewContext<'_, Editor> )

source§

impl Editor

source

pub fn single_line(cx: &mut ViewContext<'_, Self>) -> Self

source

pub fn for_buffer( buffer: Model<Buffer>, project: Option<Model<Project>>, cx: &mut ViewContext<'_, Self> ) -> Self

source

pub fn for_multibuffer( buffer: Model<MultiBuffer>, project: Option<Model<Project>>, cx: &mut ViewContext<'_, Self> ) -> Self

source

pub fn clone(&self, cx: &mut ViewContext<'_, Self>) -> Self

source

pub fn new_file( workspace: &mut Workspace, _: &NewFile, cx: &mut ViewContext<'_, Workspace> )

source

pub fn replica_id(&self, cx: &AppContext) -> ReplicaId

source

pub fn buffer(&self) -> &Model<MultiBuffer>

source

pub fn title<'a>(&self, cx: &'a AppContext) -> Cow<'a, str>

source

pub fn snapshot(&mut self, cx: &mut WindowContext<'_>) -> EditorSnapshot

source

pub fn mode(&self) -> EditorMode

source

pub fn collaboration_hub(&self) -> Option<&dyn CollaborationHub>

source

pub fn set_collaboration_hub(&mut self, hub: Box<dyn CollaborationHub>)

source

pub fn set_placeholder_text( &mut self, placeholder_text: impl Into<Arc<str>>, cx: &mut ViewContext<'_, Self> )

source

pub fn range_for_match<T: Copy>(&self, range: &Range<T>) -> Range<T>

source

pub fn change_selections<R>( &mut self, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self>, change: impl FnOnce(&mut MutableSelectionsCollection<'_>) -> R ) -> R

source

pub fn edit<I, S, T>(&mut self, edits: I, cx: &mut ViewContext<'_, Self>)where I: IntoIterator<Item = (Range<S>, T)>, S: ToOffset, T: Into<Arc<str>>,

source

pub fn edit_with_autoindent<I, S, T>( &mut self, edits: I, cx: &mut ViewContext<'_, Self> )where I: IntoIterator<Item = (Range<S>, T)>, S: ToOffset, T: Into<Arc<str>>,

source

pub fn edit_with_block_indent<I, S, T>( &mut self, edits: I, original_indent_columns: Vec<u32>, cx: &mut ViewContext<'_, Self> )where I: IntoIterator<Item = (Range<S>, T)>, S: ToOffset, T: Into<Arc<str>>,

source

pub fn has_pending_nonempty_selection(&self) -> bool

source

pub fn has_pending_selection(&self) -> bool

source

pub fn cancel(&mut self, _: &Cancel, cx: &mut ViewContext<'_, Self>)

source

pub fn handle_input(&mut self, text: &str, cx: &mut ViewContext<'_, Self>)

source

pub fn newline(&mut self, _: &Newline, cx: &mut ViewContext<'_, Self>)

source

pub fn newline_above( &mut self, _: &NewlineAbove, cx: &mut ViewContext<'_, Self> )

source

pub fn newline_below( &mut self, _: &NewlineBelow, cx: &mut ViewContext<'_, Self> )

source

pub fn insert(&mut self, text: &str, cx: &mut ViewContext<'_, Self>)

source

pub fn toggle_inlay_hints( &mut self, _: &ToggleInlayHints, cx: &mut ViewContext<'_, Self> )

source

pub fn inlay_hints_enabled(&self) -> bool

source

pub fn excerpt_visible_offsets( &self, restrict_to_languages: Option<&HashSet<Arc<Language>>>, cx: &mut ViewContext<'_, Editor> ) -> HashMap<ExcerptId, (Model<Buffer>, Global, Range<usize>)>

source

pub fn text_layout_details(&self, cx: &WindowContext<'_>) -> TextLayoutDetails

source

pub fn toggle_code_actions( &mut self, action: &ToggleCodeActions, cx: &mut ViewContext<'_, Self> )

source

pub fn confirm_code_action( &mut self, action: &ConfirmCodeAction, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>

source

pub fn render_code_actions_indicator( &self, style: &EditorStyle, is_active: bool, cx: &mut ViewContext<'_, Self> ) -> Option<IconButton>

source

pub fn render_fold_indicators( &self, fold_data: Vec<Option<(FoldStatus, u32, bool)>>, style: &EditorStyle, gutter_hovered: bool, line_height: Pixels, gutter_margin: Pixels, cx: &mut ViewContext<'_, Self> ) -> Vec<Option<IconButton>>

source

pub fn context_menu_visible(&self) -> bool

source

pub fn render_context_menu( &self, cursor_position: DisplayPoint, style: &EditorStyle, cx: &mut ViewContext<'_, Editor> ) -> Option<(DisplayPoint, AnyElement)>

source

pub fn insert_snippet( &mut self, insertion_ranges: &[Range<usize>], snippet: Snippet, cx: &mut ViewContext<'_, Self> ) -> Result<()>

source

pub fn move_to_next_snippet_tabstop( &mut self, cx: &mut ViewContext<'_, Self> ) -> bool

source

pub fn move_to_prev_snippet_tabstop( &mut self, cx: &mut ViewContext<'_, Self> ) -> bool

source

pub fn move_to_snippet_tabstop( &mut self, bias: Bias, cx: &mut ViewContext<'_, Self> ) -> bool

source

pub fn clear(&mut self, cx: &mut ViewContext<'_, Self>)

source

pub fn backspace(&mut self, _: &Backspace, cx: &mut ViewContext<'_, Self>)

source

pub fn delete(&mut self, _: &Delete, cx: &mut ViewContext<'_, Self>)

source

pub fn tab_prev(&mut self, _: &TabPrev, cx: &mut ViewContext<'_, Self>)

source

pub fn tab(&mut self, _: &Tab, cx: &mut ViewContext<'_, Self>)

source

pub fn indent(&mut self, _: &Indent, cx: &mut ViewContext<'_, Self>)

source

pub fn outdent(&mut self, _: &Outdent, cx: &mut ViewContext<'_, Self>)

source

pub fn delete_line(&mut self, _: &DeleteLine, cx: &mut ViewContext<'_, Self>)

source

pub fn join_lines(&mut self, _: &JoinLines, cx: &mut ViewContext<'_, Self>)

source

pub fn sort_lines_case_sensitive( &mut self, _: &SortLinesCaseSensitive, cx: &mut ViewContext<'_, Self> )

source

pub fn sort_lines_case_insensitive( &mut self, _: &SortLinesCaseInsensitive, cx: &mut ViewContext<'_, Self> )

source

pub fn reverse_lines( &mut self, _: &ReverseLines, cx: &mut ViewContext<'_, Self> )

source

pub fn shuffle_lines( &mut self, _: &ShuffleLines, cx: &mut ViewContext<'_, Self> )

source

pub fn convert_to_upper_case( &mut self, _: &ConvertToUpperCase, cx: &mut ViewContext<'_, Self> )

source

pub fn convert_to_lower_case( &mut self, _: &ConvertToLowerCase, cx: &mut ViewContext<'_, Self> )

source

pub fn convert_to_title_case( &mut self, _: &ConvertToTitleCase, cx: &mut ViewContext<'_, Self> )

source

pub fn convert_to_snake_case( &mut self, _: &ConvertToSnakeCase, cx: &mut ViewContext<'_, Self> )

source

pub fn convert_to_kebab_case( &mut self, _: &ConvertToKebabCase, cx: &mut ViewContext<'_, Self> )

source

pub fn convert_to_upper_camel_case( &mut self, _: &ConvertToUpperCamelCase, cx: &mut ViewContext<'_, Self> )

source

pub fn convert_to_lower_camel_case( &mut self, _: &ConvertToLowerCamelCase, cx: &mut ViewContext<'_, Self> )

source

pub fn duplicate_line( &mut self, _: &DuplicateLine, cx: &mut ViewContext<'_, Self> )

source

pub fn move_line_up(&mut self, _: &MoveLineUp, cx: &mut ViewContext<'_, Self>)

source

pub fn move_line_down( &mut self, _: &MoveLineDown, cx: &mut ViewContext<'_, Self> )

source

pub fn transpose(&mut self, _: &Transpose, cx: &mut ViewContext<'_, Self>)

source

pub fn cut(&mut self, _: &Cut, cx: &mut ViewContext<'_, Self>)

source

pub fn copy(&mut self, _: &Copy, cx: &mut ViewContext<'_, Self>)

source

pub fn paste(&mut self, _: &Paste, cx: &mut ViewContext<'_, Self>)

source

pub fn undo(&mut self, _: &Undo, cx: &mut ViewContext<'_, Self>)

source

pub fn redo(&mut self, _: &Redo, cx: &mut ViewContext<'_, Self>)

source

pub fn finalize_last_transaction(&mut self, cx: &mut ViewContext<'_, Self>)

source

pub fn move_left(&mut self, _: &MoveLeft, cx: &mut ViewContext<'_, Self>)

source

pub fn select_left(&mut self, _: &SelectLeft, cx: &mut ViewContext<'_, Self>)

source

pub fn move_right(&mut self, _: &MoveRight, cx: &mut ViewContext<'_, Self>)

source

pub fn select_right(&mut self, _: &SelectRight, cx: &mut ViewContext<'_, Self>)

source

pub fn move_up(&mut self, _: &MoveUp, cx: &mut ViewContext<'_, Self>)

source

pub fn move_page_up( &mut self, action: &MovePageUp, cx: &mut ViewContext<'_, Self> )

source

pub fn select_up(&mut self, _: &SelectUp, cx: &mut ViewContext<'_, Self>)

source

pub fn move_down(&mut self, _: &MoveDown, cx: &mut ViewContext<'_, Self>)

source

pub fn move_page_down( &mut self, action: &MovePageDown, cx: &mut ViewContext<'_, Self> )

source

pub fn select_down(&mut self, _: &SelectDown, cx: &mut ViewContext<'_, Self>)

source

pub fn context_menu_first( &mut self, _: &ContextMenuFirst, cx: &mut ViewContext<'_, Self> )

source

pub fn context_menu_prev( &mut self, _: &ContextMenuPrev, cx: &mut ViewContext<'_, Self> )

source

pub fn context_menu_next( &mut self, _: &ContextMenuNext, cx: &mut ViewContext<'_, Self> )

source

pub fn context_menu_last( &mut self, _: &ContextMenuLast, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_previous_word_start( &mut self, _: &MoveToPreviousWordStart, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_previous_subword_start( &mut self, _: &MoveToPreviousSubwordStart, cx: &mut ViewContext<'_, Self> )

source

pub fn select_to_previous_word_start( &mut self, _: &SelectToPreviousWordStart, cx: &mut ViewContext<'_, Self> )

source

pub fn select_to_previous_subword_start( &mut self, _: &SelectToPreviousSubwordStart, cx: &mut ViewContext<'_, Self> )

source

pub fn delete_to_previous_word_start( &mut self, _: &DeleteToPreviousWordStart, cx: &mut ViewContext<'_, Self> )

source

pub fn delete_to_previous_subword_start( &mut self, _: &DeleteToPreviousSubwordStart, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_next_word_end( &mut self, _: &MoveToNextWordEnd, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_next_subword_end( &mut self, _: &MoveToNextSubwordEnd, cx: &mut ViewContext<'_, Self> )

source

pub fn select_to_next_word_end( &mut self, _: &SelectToNextWordEnd, cx: &mut ViewContext<'_, Self> )

source

pub fn select_to_next_subword_end( &mut self, _: &SelectToNextSubwordEnd, cx: &mut ViewContext<'_, Self> )

source

pub fn delete_to_next_word_end( &mut self, _: &DeleteToNextWordEnd, cx: &mut ViewContext<'_, Self> )

source

pub fn delete_to_next_subword_end( &mut self, _: &DeleteToNextSubwordEnd, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_beginning_of_line( &mut self, _: &MoveToBeginningOfLine, cx: &mut ViewContext<'_, Self> )

source

pub fn select_to_beginning_of_line( &mut self, action: &SelectToBeginningOfLine, cx: &mut ViewContext<'_, Self> )

source

pub fn delete_to_beginning_of_line( &mut self, _: &DeleteToBeginningOfLine, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_end_of_line( &mut self, _: &MoveToEndOfLine, cx: &mut ViewContext<'_, Self> )

source

pub fn select_to_end_of_line( &mut self, action: &SelectToEndOfLine, cx: &mut ViewContext<'_, Self> )

source

pub fn delete_to_end_of_line( &mut self, _: &DeleteToEndOfLine, cx: &mut ViewContext<'_, Self> )

source

pub fn cut_to_end_of_line( &mut self, _: &CutToEndOfLine, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_start_of_paragraph( &mut self, _: &MoveToStartOfParagraph, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_end_of_paragraph( &mut self, _: &MoveToEndOfParagraph, cx: &mut ViewContext<'_, Self> )

source

pub fn select_to_start_of_paragraph( &mut self, _: &SelectToStartOfParagraph, cx: &mut ViewContext<'_, Self> )

source

pub fn select_to_end_of_paragraph( &mut self, _: &SelectToEndOfParagraph, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_beginning( &mut self, _: &MoveToBeginning, cx: &mut ViewContext<'_, Self> )

source

pub fn select_to_beginning( &mut self, _: &SelectToBeginning, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_end(&mut self, _: &MoveToEnd, cx: &mut ViewContext<'_, Self>)

source

pub fn set_nav_history(&mut self, nav_history: Option<ItemNavHistory>)

source

pub fn nav_history(&self) -> Option<&ItemNavHistory>

source

pub fn select_to_end(&mut self, _: &SelectToEnd, cx: &mut ViewContext<'_, Self>)

source

pub fn select_all(&mut self, _: &SelectAll, cx: &mut ViewContext<'_, Self>)

source

pub fn select_line(&mut self, _: &SelectLine, cx: &mut ViewContext<'_, Self>)

source

pub fn split_selection_into_lines( &mut self, _: &SplitSelectionIntoLines, cx: &mut ViewContext<'_, Self> )

source

pub fn add_selection_above( &mut self, _: &AddSelectionAbove, cx: &mut ViewContext<'_, Self> )

source

pub fn add_selection_below( &mut self, _: &AddSelectionBelow, cx: &mut ViewContext<'_, Self> )

source

pub fn select_next_match_internal( &mut self, display_map: &DisplaySnapshot, replace_newest: bool, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self> ) -> Result<()>

source

pub fn select_all_matches( &mut self, action: &SelectAllMatches, cx: &mut ViewContext<'_, Self> ) -> Result<()>

source

pub fn select_next( &mut self, action: &SelectNext, cx: &mut ViewContext<'_, Self> ) -> Result<()>

source

pub fn select_previous( &mut self, action: &SelectPrevious, cx: &mut ViewContext<'_, Self> ) -> Result<()>

source

pub fn toggle_comments( &mut self, action: &ToggleComments, cx: &mut ViewContext<'_, Self> )

source

pub fn select_larger_syntax_node( &mut self, _: &SelectLargerSyntaxNode, cx: &mut ViewContext<'_, Self> )

source

pub fn select_smaller_syntax_node( &mut self, _: &SelectSmallerSyntaxNode, cx: &mut ViewContext<'_, Self> )

source

pub fn move_to_enclosing_bracket( &mut self, _: &MoveToEnclosingBracket, cx: &mut ViewContext<'_, Self> )

source

pub fn undo_selection( &mut self, _: &UndoSelection, cx: &mut ViewContext<'_, Self> )

source

pub fn redo_selection( &mut self, _: &RedoSelection, cx: &mut ViewContext<'_, Self> )

source

pub fn go_to_diagnostic_impl( &mut self, direction: Direction, cx: &mut ViewContext<'_, Self> )

source

pub fn go_to_definition( &mut self, _: &GoToDefinition, cx: &mut ViewContext<'_, Self> )

source

pub fn go_to_type_definition( &mut self, _: &GoToTypeDefinition, cx: &mut ViewContext<'_, Self> )

source

pub fn go_to_definition_split( &mut self, _: &GoToDefinitionSplit, cx: &mut ViewContext<'_, Self> )

source

pub fn go_to_type_definition_split( &mut self, _: &GoToTypeDefinitionSplit, cx: &mut ViewContext<'_, Self> )

source

pub fn navigate_to_definitions( &mut self, definitions: Vec<GoToDefinitionLink>, split: bool, cx: &mut ViewContext<'_, Editor> )

source

pub fn find_all_references( &mut self, _: &FindAllReferences, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>

source

pub fn open_locations_in_multibuffer( workspace: &mut Workspace, locations: Vec<Location>, replica_id: ReplicaId, title: String, split: bool, cx: &mut ViewContext<'_, Workspace> )

Opens a multibuffer with the given project locations in it

source

pub fn rename( &mut self, _: &Rename, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>

source

pub fn confirm_rename( &mut self, _: &ConfirmRename, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>

source

pub fn set_selections_from_remote( &mut self, selections: Vec<Selection<Anchor>>, pending_selection: Option<Selection<Anchor>>, cx: &mut ViewContext<'_, Self> )

source

pub fn transact( &mut self, cx: &mut ViewContext<'_, Self>, update: impl FnOnce(&mut Self, &mut ViewContext<'_, Self>) ) -> Option<TransactionId>

source

pub fn fold(&mut self, _: &Fold, cx: &mut ViewContext<'_, Self>)

source

pub fn fold_at(&mut self, fold_at: &FoldAt, cx: &mut ViewContext<'_, Self>)

source

pub fn unfold_lines(&mut self, _: &UnfoldLines, cx: &mut ViewContext<'_, Self>)

source

pub fn unfold_at( &mut self, unfold_at: &UnfoldAt, cx: &mut ViewContext<'_, Self> )

source

pub fn fold_selected_ranges( &mut self, _: &FoldSelectedRanges, cx: &mut ViewContext<'_, Self> )

source

pub fn fold_ranges<T: ToOffset + Clone>( &mut self, ranges: impl IntoIterator<Item = Range<T>>, auto_scroll: bool, cx: &mut ViewContext<'_, Self> )

source

pub fn unfold_ranges<T: ToOffset + Clone>( &mut self, ranges: impl IntoIterator<Item = Range<T>>, inclusive: bool, auto_scroll: bool, cx: &mut ViewContext<'_, Self> )

source

pub fn set_gutter_hovered( &mut self, hovered: bool, cx: &mut ViewContext<'_, Self> )

source

pub fn insert_blocks( &mut self, blocks: impl IntoIterator<Item = BlockProperties<Anchor>>, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self> ) -> Vec<BlockId>

source

pub fn replace_blocks( &mut self, blocks: HashMap<BlockId, RenderBlock>, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self> )

source

pub fn remove_blocks( &mut self, block_ids: HashSet<BlockId>, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self> )

source

pub fn longest_row(&self, cx: &mut AppContext) -> u32

source

pub fn max_point(&self, cx: &mut AppContext) -> DisplayPoint

source

pub fn text(&self, cx: &AppContext) -> String

source

pub fn set_text( &mut self, text: impl Into<Arc<str>>, cx: &mut ViewContext<'_, Self> )

source

pub fn display_text(&self, cx: &mut AppContext) -> String

source

pub fn wrap_guides(&self, cx: &AppContext) -> SmallVec<[(usize, bool); 2]>

source

pub fn soft_wrap_mode(&self, cx: &AppContext) -> SoftWrap

source

pub fn set_soft_wrap_mode( &mut self, mode: SoftWrap, cx: &mut ViewContext<'_, Self> )

source

pub fn set_wrap_width(&self, width: Option<Pixels>, cx: &mut AppContext) -> bool

source

pub fn toggle_soft_wrap( &mut self, _: &ToggleSoftWrap, cx: &mut ViewContext<'_, Self> )

source

pub fn set_show_gutter( &mut self, show_gutter: bool, cx: &mut ViewContext<'_, Self> )

source

pub fn set_show_wrap_guides( &mut self, show_gutter: bool, cx: &mut ViewContext<'_, Self> )

source

pub fn reveal_in_finder( &mut self, _: &RevealInFinder, cx: &mut ViewContext<'_, Self> )

source

pub fn copy_path(&mut self, _: &CopyPath, cx: &mut ViewContext<'_, Self>)

source

pub fn copy_relative_path( &mut self, _: &CopyRelativePath, cx: &mut ViewContext<'_, Self> )

source

pub fn highlight_rows(&mut self, rows: Option<Range<u32>>)

source

pub fn highlighted_rows(&self) -> Option<Range<u32>>

source

pub fn highlight_background<T: 'static>( &mut self, ranges: Vec<Range<Anchor>>, color_fetcher: fn(_: &ThemeColors) -> Hsla, cx: &mut ViewContext<'_, Self> )

source

pub fn highlight_inlay_background<T: 'static>( &mut self, ranges: Vec<InlayHighlight>, color_fetcher: fn(_: &ThemeColors) -> Hsla, cx: &mut ViewContext<'_, Self> )

source

pub fn clear_background_highlights<T: 'static>( &mut self, cx: &mut ViewContext<'_, Self> ) -> Option<(fn(_: &ThemeColors) -> Hsla, Vec<Range<Anchor>>)>

source

pub fn background_highlights_in_range( &self, search_range: Range<Anchor>, display_snapshot: &DisplaySnapshot, theme: &ThemeColors ) -> Vec<(Range<DisplayPoint>, Hsla)>

source

pub fn background_highlight_row_ranges<T: 'static>( &self, search_range: Range<Anchor>, display_snapshot: &DisplaySnapshot, count: usize ) -> Vec<RangeInclusive<DisplayPoint>>

source

pub fn highlight_text<T: 'static>( &mut self, ranges: Vec<Range<Anchor>>, style: HighlightStyle, cx: &mut ViewContext<'_, Self> )

source

pub fn highlight_inlays<T: 'static>( &mut self, highlights: Vec<InlayHighlight>, style: HighlightStyle, cx: &mut ViewContext<'_, Self> )

source

pub fn text_highlights<'a, T: 'static>( &'a self, cx: &'a AppContext ) -> Option<(HighlightStyle, &'a [Range<Anchor>])>

source

pub fn clear_highlights<T: 'static>(&mut self, cx: &mut ViewContext<'_, Self>)

source

pub fn show_local_cursors(&self, cx: &WindowContext<'_>) -> bool

source

pub fn inlay_hint_cache(&self) -> &InlayHintCache

source

pub fn replay_insert_event( &mut self, text: &str, relative_utf16_range: Option<Range<isize>>, cx: &mut ViewContext<'_, Self> )

source

pub fn supports_inlay_hints(&self, cx: &AppContext) -> bool

source

pub fn focus(&self, cx: &mut WindowContext<'_>)

source

pub fn is_focused(&self, cx: &WindowContext<'_>) -> bool

Trait Implementations§

source§

impl FocusableView for Editor

source§

impl FollowableItem for Editor

§

type FollowableEvent = EditorEvent

source§

fn remote_id(&self) -> Option<ViewId>

source§

fn from_state_proto( pane: View<Pane>, workspace: View<Workspace>, remote_id: ViewId, state: &mut Option<Variant>, cx: &mut AppContext ) -> Option<Task<Result<View<Self>>>>

source§

fn set_leader_peer_id( &mut self, leader_peer_id: Option<PeerId>, cx: &mut ViewContext<'_, Self> )

source§

fn to_state_proto(&self, cx: &AppContext) -> Option<Variant>

source§

fn add_event_to_update_proto( &self, event: &Self::FollowableEvent, update: &mut Option<Variant>, cx: &AppContext ) -> bool

source§

fn apply_update_proto( &mut self, project: &Model<Project>, message: Variant, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>

source§

fn is_project_item(&self, _cx: &AppContext) -> bool

source§

impl InputHandler for Editor

source§

fn text_for_range( &mut self, range_utf16: Range<usize>, cx: &mut ViewContext<'_, Self> ) -> Option<String>

source§

fn selected_text_range( &mut self, cx: &mut ViewContext<'_, Self> ) -> Option<Range<usize>>

source§

fn marked_text_range( &self, cx: &mut ViewContext<'_, Self> ) -> Option<Range<usize>>

source§

fn unmark_text(&mut self, cx: &mut ViewContext<'_, Self>)

source§

fn replace_text_in_range( &mut self, range_utf16: Option<Range<usize>>, text: &str, cx: &mut ViewContext<'_, Self> )

source§

fn replace_and_mark_text_in_range( &mut self, range_utf16: Option<Range<usize>>, text: &str, new_selected_range_utf16: Option<Range<usize>>, cx: &mut ViewContext<'_, Self> )

source§

fn bounds_for_range( &mut self, range_utf16: Range<usize>, element_bounds: Bounds<Pixels>, cx: &mut ViewContext<'_, Self> ) -> Option<Bounds<Pixels>>

source§

impl Item for Editor

source§

fn navigate( &mut self, data: Box<dyn Any>, cx: &mut ViewContext<'_, Self> ) -> bool

source§

fn tab_tooltip_text(&self, cx: &AppContext) -> Option<SharedString>

source§

fn tab_description<'a>( &self, detail: usize, cx: &'a AppContext ) -> Option<SharedString>

source§

fn tab_content( &self, detail: Option<usize>, cx: &WindowContext<'_> ) -> AnyElement

source§

fn for_each_project_item( &self, cx: &AppContext, f: &mut dyn FnMut(EntityId, &dyn Item) )

(model id, Item)
source§

fn is_singleton(&self, cx: &AppContext) -> bool

source§

fn clone_on_split( &self, _workspace_id: WorkspaceId, cx: &mut ViewContext<'_, Self> ) -> Option<View<Editor>>where Self: Sized,

source§

fn set_nav_history( &mut self, history: ItemNavHistory, _: &mut ViewContext<'_, Self> )

source§

fn deactivated(&mut self, cx: &mut ViewContext<'_, Self>)

source§

fn workspace_deactivated(&mut self, cx: &mut ViewContext<'_, Self>)

source§

fn is_dirty(&self, cx: &AppContext) -> bool

source§

fn has_conflict(&self, cx: &AppContext) -> bool

source§

fn can_save(&self, cx: &AppContext) -> bool

source§

fn save( &mut self, project: Model<Project>, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>

source§

fn save_as( &mut self, project: Model<Project>, abs_path: PathBuf, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>

source§

fn reload( &mut self, project: Model<Project>, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>

source§

fn as_searchable( &self, handle: &View<Self> ) -> Option<Box<dyn SearchableItemHandle>>

source§

fn pixel_position_of_cursor(&self, _: &AppContext) -> Option<Point<Pixels>>

source§

fn breadcrumb_location(&self) -> ToolbarItemLocation

source§

fn breadcrumbs( &self, variant: &Theme, cx: &AppContext ) -> Option<Vec<BreadcrumbText>>

source§

fn added_to_workspace( &mut self, workspace: &mut Workspace, cx: &mut ViewContext<'_, Self> )

source§

fn serialized_item_kind() -> Option<&'static str>

source§

fn deserialize( project: Model<Project>, _workspace: WeakView<Workspace>, workspace_id: WorkspaceId, item_id: ItemId, cx: &mut ViewContext<'_, Pane> ) -> Task<Result<View<Self>>>

source§

fn act_as_type<'a>( &'a self, type_id: TypeId, self_handle: &'a View<Self>, _: &'a AppContext ) -> Option<AnyView>

source§

fn show_toolbar(&self) -> bool

source§

impl ProjectItem for Editor

§

type Item = Buffer

source§

fn for_project_item( project: Model<Project>, buffer: Model<Buffer>, cx: &mut ViewContext<'_, Self> ) -> Self

source§

impl Render for Editor

§

type Element = EditorElement

source§

fn render(&mut self, cx: &mut ViewContext<'_, Self>) -> Self::Element

source§

impl SearchableItem for Editor

§

type Match = Range<Anchor>

source§

fn clear_matches(&mut self, cx: &mut ViewContext<'_, Self>)

source§

fn update_matches( &mut self, matches: Vec<Range<Anchor>>, cx: &mut ViewContext<'_, Self> )

source§

fn query_suggestion(&mut self, cx: &mut ViewContext<'_, Self>) -> String

source§

fn activate_match( &mut self, index: usize, matches: Vec<Range<Anchor>>, cx: &mut ViewContext<'_, Self> )

source§

fn select_matches( &mut self, matches: Vec<Self::Match>, cx: &mut ViewContext<'_, Self> )

source§

fn replace( &mut self, identifier: &Self::Match, query: &SearchQuery, cx: &mut ViewContext<'_, Self> )

source§

fn match_index_for_direction( &mut self, matches: &Vec<Range<Anchor>>, current_index: usize, direction: Direction, count: usize, cx: &mut ViewContext<'_, Self> ) -> usize

source§

fn find_matches( &mut self, query: Arc<SearchQuery>, cx: &mut ViewContext<'_, Self> ) -> Task<Vec<Range<Anchor>>>

source§

fn active_match_index( &mut self, matches: Vec<Range<Anchor>>, cx: &mut ViewContext<'_, Self> ) -> Option<usize>

source§

fn supported_options() -> SearchOptions

source§

impl EventEmitter<EditorEvent> for Editor

source§

impl EventEmitter<ItemEvent> for Editor

source§

impl EventEmitter<SearchEvent> for Editor

Auto Trait Implementations§

§

impl !RefUnwindSafe for Editor

§

impl !Send for Editor

§

impl !Sync for Editor

§

impl Unpin for Editor

§

impl !UnwindSafe for Editor

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,