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
impl Editor
pub fn next_screen(&mut self, _: &NextScreen, cx: &mut ViewContext<'_, Editor>)
pub fn scroll( &mut self, scroll_position: Point<f32>, axis: Option<Axis>, cx: &mut ViewContext<'_, Self> )
pub fn scroll_cursor_top( &mut self, _: &ScrollCursorTop, cx: &mut ViewContext<'_, Editor> )
pub fn scroll_cursor_center( &mut self, _: &ScrollCursorCenter, cx: &mut ViewContext<'_, Editor> )
pub fn scroll_cursor_bottom( &mut self, _: &ScrollCursorBottom, cx: &mut ViewContext<'_, Editor> )
source§impl Editor
impl Editor
pub fn autoscroll_vertically( &mut self, viewport_height: Pixels, line_height: Pixels, cx: &mut ViewContext<'_, Editor> ) -> bool
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
pub fn request_autoscroll( &mut self, autoscroll: Autoscroll, cx: &mut ViewContext<'_, Self> )
source§impl Editor
impl Editor
pub fn vertical_scroll_margin(&mut self) -> usize
pub fn set_vertical_scroll_margin( &mut self, margin_rows: usize, cx: &mut ViewContext<'_, Self> )
pub fn visible_line_count(&self) -> Option<f32>
pub fn set_scroll_position( &mut self, scroll_position: Point<f32>, cx: &mut ViewContext<'_, Self> )
pub fn scroll_position(&self, cx: &mut ViewContext<'_, Self>) -> Point<f32>
pub fn set_scroll_anchor( &mut self, scroll_anchor: ScrollAnchor, cx: &mut ViewContext<'_, Self> )
pub fn scroll_screen( &mut self, amount: &ScrollAmount, cx: &mut ViewContext<'_, Self> )
sourcepub fn newest_selection_on_screen(&self, cx: &mut AppContext) -> Ordering
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
pub fn read_scroll_position_from_db( &mut self, item_id: u64, workspace_id: WorkspaceId, cx: &mut ViewContext<'_, Editor> )
source§impl Editor
impl Editor
pub fn single_line(cx: &mut ViewContext<'_, Self>) -> Self
pub fn for_buffer( buffer: Model<Buffer>, project: Option<Model<Project>>, cx: &mut ViewContext<'_, Self> ) -> Self
pub fn for_multibuffer( buffer: Model<MultiBuffer>, project: Option<Model<Project>>, cx: &mut ViewContext<'_, Self> ) -> Self
pub fn clone(&self, cx: &mut ViewContext<'_, Self>) -> Self
pub fn new_file( workspace: &mut Workspace, _: &NewFile, cx: &mut ViewContext<'_, Workspace> )
pub fn replica_id(&self, cx: &AppContext) -> ReplicaId
pub fn buffer(&self) -> &Model<MultiBuffer>
pub fn title<'a>(&self, cx: &'a AppContext) -> Cow<'a, str>
pub fn snapshot(&mut self, cx: &mut WindowContext<'_>) -> EditorSnapshot
pub fn mode(&self) -> EditorMode
pub fn collaboration_hub(&self) -> Option<&dyn CollaborationHub>
pub fn set_collaboration_hub(&mut self, hub: Box<dyn CollaborationHub>)
pub fn set_placeholder_text( &mut self, placeholder_text: impl Into<Arc<str>>, cx: &mut ViewContext<'_, Self> )
pub fn range_for_match<T: Copy>(&self, range: &Range<T>) -> Range<T> ⓘ
pub fn change_selections<R>( &mut self, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self>, change: impl FnOnce(&mut MutableSelectionsCollection<'_>) -> R ) -> R
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>>,
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>>,
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>>,
pub fn has_pending_nonempty_selection(&self) -> bool
pub fn has_pending_selection(&self) -> bool
pub fn cancel(&mut self, _: &Cancel, cx: &mut ViewContext<'_, Self>)
pub fn handle_input(&mut self, text: &str, cx: &mut ViewContext<'_, Self>)
pub fn newline(&mut self, _: &Newline, cx: &mut ViewContext<'_, Self>)
pub fn newline_above( &mut self, _: &NewlineAbove, cx: &mut ViewContext<'_, Self> )
pub fn newline_below( &mut self, _: &NewlineBelow, cx: &mut ViewContext<'_, Self> )
pub fn insert(&mut self, text: &str, cx: &mut ViewContext<'_, Self>)
pub fn toggle_inlay_hints( &mut self, _: &ToggleInlayHints, cx: &mut ViewContext<'_, Self> )
pub fn inlay_hints_enabled(&self) -> bool
pub fn excerpt_visible_offsets( &self, restrict_to_languages: Option<&HashSet<Arc<Language>>>, cx: &mut ViewContext<'_, Editor> ) -> HashMap<ExcerptId, (Model<Buffer>, Global, Range<usize>)>
pub fn text_layout_details(&self, cx: &WindowContext<'_>) -> TextLayoutDetails
pub fn toggle_code_actions( &mut self, action: &ToggleCodeActions, cx: &mut ViewContext<'_, Self> )
pub fn confirm_code_action( &mut self, action: &ConfirmCodeAction, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>
pub fn render_code_actions_indicator( &self, style: &EditorStyle, is_active: bool, cx: &mut ViewContext<'_, Self> ) -> Option<IconButton>
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>>
pub fn insert_snippet( &mut self, insertion_ranges: &[Range<usize>], snippet: Snippet, cx: &mut ViewContext<'_, Self> ) -> Result<()>
pub fn move_to_next_snippet_tabstop( &mut self, cx: &mut ViewContext<'_, Self> ) -> bool
pub fn move_to_prev_snippet_tabstop( &mut self, cx: &mut ViewContext<'_, Self> ) -> bool
pub fn move_to_snippet_tabstop( &mut self, bias: Bias, cx: &mut ViewContext<'_, Self> ) -> bool
pub fn clear(&mut self, cx: &mut ViewContext<'_, Self>)
pub fn backspace(&mut self, _: &Backspace, cx: &mut ViewContext<'_, Self>)
pub fn delete(&mut self, _: &Delete, cx: &mut ViewContext<'_, Self>)
pub fn tab_prev(&mut self, _: &TabPrev, cx: &mut ViewContext<'_, Self>)
pub fn tab(&mut self, _: &Tab, cx: &mut ViewContext<'_, Self>)
pub fn indent(&mut self, _: &Indent, cx: &mut ViewContext<'_, Self>)
pub fn outdent(&mut self, _: &Outdent, cx: &mut ViewContext<'_, Self>)
pub fn delete_line(&mut self, _: &DeleteLine, cx: &mut ViewContext<'_, Self>)
pub fn join_lines(&mut self, _: &JoinLines, cx: &mut ViewContext<'_, Self>)
pub fn sort_lines_case_sensitive( &mut self, _: &SortLinesCaseSensitive, cx: &mut ViewContext<'_, Self> )
pub fn sort_lines_case_insensitive( &mut self, _: &SortLinesCaseInsensitive, cx: &mut ViewContext<'_, Self> )
pub fn reverse_lines( &mut self, _: &ReverseLines, cx: &mut ViewContext<'_, Self> )
pub fn shuffle_lines( &mut self, _: &ShuffleLines, cx: &mut ViewContext<'_, Self> )
pub fn convert_to_upper_case( &mut self, _: &ConvertToUpperCase, cx: &mut ViewContext<'_, Self> )
pub fn convert_to_lower_case( &mut self, _: &ConvertToLowerCase, cx: &mut ViewContext<'_, Self> )
pub fn convert_to_title_case( &mut self, _: &ConvertToTitleCase, cx: &mut ViewContext<'_, Self> )
pub fn convert_to_snake_case( &mut self, _: &ConvertToSnakeCase, cx: &mut ViewContext<'_, Self> )
pub fn convert_to_kebab_case( &mut self, _: &ConvertToKebabCase, cx: &mut ViewContext<'_, Self> )
pub fn convert_to_upper_camel_case( &mut self, _: &ConvertToUpperCamelCase, cx: &mut ViewContext<'_, Self> )
pub fn convert_to_lower_camel_case( &mut self, _: &ConvertToLowerCamelCase, cx: &mut ViewContext<'_, Self> )
pub fn duplicate_line( &mut self, _: &DuplicateLine, cx: &mut ViewContext<'_, Self> )
pub fn move_line_up(&mut self, _: &MoveLineUp, cx: &mut ViewContext<'_, Self>)
pub fn move_line_down( &mut self, _: &MoveLineDown, cx: &mut ViewContext<'_, Self> )
pub fn transpose(&mut self, _: &Transpose, cx: &mut ViewContext<'_, Self>)
pub fn cut(&mut self, _: &Cut, cx: &mut ViewContext<'_, Self>)
pub fn copy(&mut self, _: &Copy, cx: &mut ViewContext<'_, Self>)
pub fn paste(&mut self, _: &Paste, cx: &mut ViewContext<'_, Self>)
pub fn undo(&mut self, _: &Undo, cx: &mut ViewContext<'_, Self>)
pub fn redo(&mut self, _: &Redo, cx: &mut ViewContext<'_, Self>)
pub fn finalize_last_transaction(&mut self, cx: &mut ViewContext<'_, Self>)
pub fn move_left(&mut self, _: &MoveLeft, cx: &mut ViewContext<'_, Self>)
pub fn select_left(&mut self, _: &SelectLeft, cx: &mut ViewContext<'_, Self>)
pub fn move_right(&mut self, _: &MoveRight, cx: &mut ViewContext<'_, Self>)
pub fn select_right(&mut self, _: &SelectRight, cx: &mut ViewContext<'_, Self>)
pub fn move_up(&mut self, _: &MoveUp, cx: &mut ViewContext<'_, Self>)
pub fn move_page_up( &mut self, action: &MovePageUp, cx: &mut ViewContext<'_, Self> )
pub fn select_up(&mut self, _: &SelectUp, cx: &mut ViewContext<'_, Self>)
pub fn move_down(&mut self, _: &MoveDown, cx: &mut ViewContext<'_, Self>)
pub fn move_page_down( &mut self, action: &MovePageDown, cx: &mut ViewContext<'_, Self> )
pub fn select_down(&mut self, _: &SelectDown, cx: &mut ViewContext<'_, Self>)
pub fn move_to_previous_word_start( &mut self, _: &MoveToPreviousWordStart, cx: &mut ViewContext<'_, Self> )
pub fn move_to_previous_subword_start( &mut self, _: &MoveToPreviousSubwordStart, cx: &mut ViewContext<'_, Self> )
pub fn select_to_previous_word_start( &mut self, _: &SelectToPreviousWordStart, cx: &mut ViewContext<'_, Self> )
pub fn select_to_previous_subword_start( &mut self, _: &SelectToPreviousSubwordStart, cx: &mut ViewContext<'_, Self> )
pub fn delete_to_previous_word_start( &mut self, _: &DeleteToPreviousWordStart, cx: &mut ViewContext<'_, Self> )
pub fn delete_to_previous_subword_start( &mut self, _: &DeleteToPreviousSubwordStart, cx: &mut ViewContext<'_, Self> )
pub fn move_to_next_word_end( &mut self, _: &MoveToNextWordEnd, cx: &mut ViewContext<'_, Self> )
pub fn move_to_next_subword_end( &mut self, _: &MoveToNextSubwordEnd, cx: &mut ViewContext<'_, Self> )
pub fn select_to_next_word_end( &mut self, _: &SelectToNextWordEnd, cx: &mut ViewContext<'_, Self> )
pub fn select_to_next_subword_end( &mut self, _: &SelectToNextSubwordEnd, cx: &mut ViewContext<'_, Self> )
pub fn delete_to_next_word_end( &mut self, _: &DeleteToNextWordEnd, cx: &mut ViewContext<'_, Self> )
pub fn delete_to_next_subword_end( &mut self, _: &DeleteToNextSubwordEnd, cx: &mut ViewContext<'_, Self> )
pub fn move_to_beginning_of_line( &mut self, _: &MoveToBeginningOfLine, cx: &mut ViewContext<'_, Self> )
pub fn select_to_beginning_of_line( &mut self, action: &SelectToBeginningOfLine, cx: &mut ViewContext<'_, Self> )
pub fn delete_to_beginning_of_line( &mut self, _: &DeleteToBeginningOfLine, cx: &mut ViewContext<'_, Self> )
pub fn move_to_end_of_line( &mut self, _: &MoveToEndOfLine, cx: &mut ViewContext<'_, Self> )
pub fn select_to_end_of_line( &mut self, action: &SelectToEndOfLine, cx: &mut ViewContext<'_, Self> )
pub fn delete_to_end_of_line( &mut self, _: &DeleteToEndOfLine, cx: &mut ViewContext<'_, Self> )
pub fn cut_to_end_of_line( &mut self, _: &CutToEndOfLine, cx: &mut ViewContext<'_, Self> )
pub fn move_to_start_of_paragraph( &mut self, _: &MoveToStartOfParagraph, cx: &mut ViewContext<'_, Self> )
pub fn move_to_end_of_paragraph( &mut self, _: &MoveToEndOfParagraph, cx: &mut ViewContext<'_, Self> )
pub fn select_to_start_of_paragraph( &mut self, _: &SelectToStartOfParagraph, cx: &mut ViewContext<'_, Self> )
pub fn select_to_end_of_paragraph( &mut self, _: &SelectToEndOfParagraph, cx: &mut ViewContext<'_, Self> )
pub fn move_to_beginning( &mut self, _: &MoveToBeginning, cx: &mut ViewContext<'_, Self> )
pub fn select_to_beginning( &mut self, _: &SelectToBeginning, cx: &mut ViewContext<'_, Self> )
pub fn move_to_end(&mut self, _: &MoveToEnd, cx: &mut ViewContext<'_, Self>)
pub fn select_to_end(&mut self, _: &SelectToEnd, cx: &mut ViewContext<'_, Self>)
pub fn select_all(&mut self, _: &SelectAll, cx: &mut ViewContext<'_, Self>)
pub fn select_line(&mut self, _: &SelectLine, cx: &mut ViewContext<'_, Self>)
pub fn split_selection_into_lines( &mut self, _: &SplitSelectionIntoLines, cx: &mut ViewContext<'_, Self> )
pub fn add_selection_above( &mut self, _: &AddSelectionAbove, cx: &mut ViewContext<'_, Self> )
pub fn add_selection_below( &mut self, _: &AddSelectionBelow, cx: &mut ViewContext<'_, Self> )
pub fn select_next_match_internal( &mut self, display_map: &DisplaySnapshot, replace_newest: bool, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self> ) -> Result<()>
pub fn select_all_matches( &mut self, action: &SelectAllMatches, cx: &mut ViewContext<'_, Self> ) -> Result<()>
pub fn select_next( &mut self, action: &SelectNext, cx: &mut ViewContext<'_, Self> ) -> Result<()>
pub fn select_previous( &mut self, action: &SelectPrevious, cx: &mut ViewContext<'_, Self> ) -> Result<()>
pub fn toggle_comments( &mut self, action: &ToggleComments, cx: &mut ViewContext<'_, Self> )
pub fn select_larger_syntax_node( &mut self, _: &SelectLargerSyntaxNode, cx: &mut ViewContext<'_, Self> )
pub fn select_smaller_syntax_node( &mut self, _: &SelectSmallerSyntaxNode, cx: &mut ViewContext<'_, Self> )
pub fn move_to_enclosing_bracket( &mut self, _: &MoveToEnclosingBracket, cx: &mut ViewContext<'_, Self> )
pub fn undo_selection( &mut self, _: &UndoSelection, cx: &mut ViewContext<'_, Self> )
pub fn redo_selection( &mut self, _: &RedoSelection, cx: &mut ViewContext<'_, Self> )
pub fn go_to_diagnostic_impl( &mut self, direction: Direction, cx: &mut ViewContext<'_, Self> )
pub fn go_to_definition( &mut self, _: &GoToDefinition, cx: &mut ViewContext<'_, Self> )
pub fn go_to_type_definition( &mut self, _: &GoToTypeDefinition, cx: &mut ViewContext<'_, Self> )
pub fn go_to_definition_split( &mut self, _: &GoToDefinitionSplit, cx: &mut ViewContext<'_, Self> )
pub fn go_to_type_definition_split( &mut self, _: &GoToTypeDefinitionSplit, cx: &mut ViewContext<'_, Self> )
pub fn find_all_references( &mut self, _: &FindAllReferences, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>
sourcepub fn open_locations_in_multibuffer(
workspace: &mut Workspace,
locations: Vec<Location>,
replica_id: ReplicaId,
title: String,
split: bool,
cx: &mut ViewContext<'_, Workspace>
)
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
pub fn rename( &mut self, _: &Rename, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>
pub fn confirm_rename( &mut self, _: &ConfirmRename, cx: &mut ViewContext<'_, Self> ) -> Option<Task<Result<()>>>
pub fn set_selections_from_remote( &mut self, selections: Vec<Selection<Anchor>>, pending_selection: Option<Selection<Anchor>>, cx: &mut ViewContext<'_, Self> )
pub fn transact( &mut self, cx: &mut ViewContext<'_, Self>, update: impl FnOnce(&mut Self, &mut ViewContext<'_, Self>) ) -> Option<TransactionId>
pub fn fold(&mut self, _: &Fold, cx: &mut ViewContext<'_, Self>)
pub fn fold_at(&mut self, fold_at: &FoldAt, cx: &mut ViewContext<'_, Self>)
pub fn unfold_lines(&mut self, _: &UnfoldLines, cx: &mut ViewContext<'_, Self>)
pub fn unfold_at( &mut self, unfold_at: &UnfoldAt, cx: &mut ViewContext<'_, Self> )
pub fn fold_selected_ranges( &mut self, _: &FoldSelectedRanges, cx: &mut ViewContext<'_, Self> )
pub fn fold_ranges<T: ToOffset + Clone>( &mut self, ranges: impl IntoIterator<Item = Range<T>>, auto_scroll: bool, cx: &mut ViewContext<'_, Self> )
pub fn unfold_ranges<T: ToOffset + Clone>( &mut self, ranges: impl IntoIterator<Item = Range<T>>, inclusive: bool, auto_scroll: bool, cx: &mut ViewContext<'_, Self> )
pub fn set_gutter_hovered( &mut self, hovered: bool, cx: &mut ViewContext<'_, Self> )
pub fn insert_blocks( &mut self, blocks: impl IntoIterator<Item = BlockProperties<Anchor>>, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self> ) -> Vec<BlockId>
pub fn replace_blocks( &mut self, blocks: HashMap<BlockId, RenderBlock>, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self> )
pub fn remove_blocks( &mut self, block_ids: HashSet<BlockId>, autoscroll: Option<Autoscroll>, cx: &mut ViewContext<'_, Self> )
pub fn longest_row(&self, cx: &mut AppContext) -> u32
pub fn max_point(&self, cx: &mut AppContext) -> DisplayPoint
pub fn text(&self, cx: &AppContext) -> String
pub fn set_text( &mut self, text: impl Into<Arc<str>>, cx: &mut ViewContext<'_, Self> )
pub fn display_text(&self, cx: &mut AppContext) -> String
pub fn wrap_guides(&self, cx: &AppContext) -> SmallVec<[(usize, bool); 2]>
pub fn soft_wrap_mode(&self, cx: &AppContext) -> SoftWrap
pub fn set_soft_wrap_mode( &mut self, mode: SoftWrap, cx: &mut ViewContext<'_, Self> )
pub fn set_wrap_width(&self, width: Option<Pixels>, cx: &mut AppContext) -> bool
pub fn toggle_soft_wrap( &mut self, _: &ToggleSoftWrap, cx: &mut ViewContext<'_, Self> )
pub fn set_show_gutter( &mut self, show_gutter: bool, cx: &mut ViewContext<'_, Self> )
pub fn set_show_wrap_guides( &mut self, show_gutter: bool, cx: &mut ViewContext<'_, Self> )
pub fn reveal_in_finder( &mut self, _: &RevealInFinder, cx: &mut ViewContext<'_, Self> )
pub fn copy_path(&mut self, _: &CopyPath, cx: &mut ViewContext<'_, Self>)
pub fn copy_relative_path( &mut self, _: &CopyRelativePath, cx: &mut ViewContext<'_, Self> )
pub fn highlight_rows(&mut self, rows: Option<Range<u32>>)
pub fn highlighted_rows(&self) -> Option<Range<u32>>
pub fn highlight_background<T: 'static>( &mut self, ranges: Vec<Range<Anchor>>, color_fetcher: fn(_: &ThemeColors) -> Hsla, cx: &mut ViewContext<'_, Self> )
pub fn highlight_inlay_background<T: 'static>( &mut self, ranges: Vec<InlayHighlight>, color_fetcher: fn(_: &ThemeColors) -> Hsla, cx: &mut ViewContext<'_, Self> )
pub fn clear_background_highlights<T: 'static>( &mut self, cx: &mut ViewContext<'_, Self> ) -> Option<(fn(_: &ThemeColors) -> Hsla, Vec<Range<Anchor>>)>
pub fn background_highlights_in_range( &self, search_range: Range<Anchor>, display_snapshot: &DisplaySnapshot, theme: &ThemeColors ) -> Vec<(Range<DisplayPoint>, Hsla)>
pub fn background_highlight_row_ranges<T: 'static>( &self, search_range: Range<Anchor>, display_snapshot: &DisplaySnapshot, count: usize ) -> Vec<RangeInclusive<DisplayPoint>>
pub fn highlight_text<T: 'static>( &mut self, ranges: Vec<Range<Anchor>>, style: HighlightStyle, cx: &mut ViewContext<'_, Self> )
pub fn highlight_inlays<T: 'static>( &mut self, highlights: Vec<InlayHighlight>, style: HighlightStyle, cx: &mut ViewContext<'_, Self> )
pub fn text_highlights<'a, T: 'static>( &'a self, cx: &'a AppContext ) -> Option<(HighlightStyle, &'a [Range<Anchor>])>
pub fn clear_highlights<T: 'static>(&mut self, cx: &mut ViewContext<'_, Self>)
pub fn show_local_cursors(&self, cx: &WindowContext<'_>) -> bool
pub fn inlay_hint_cache(&self) -> &InlayHintCache
pub fn replay_insert_event( &mut self, text: &str, relative_utf16_range: Option<Range<isize>>, cx: &mut ViewContext<'_, Self> )
pub fn supports_inlay_hints(&self, cx: &AppContext) -> bool
pub fn focus(&self, cx: &mut WindowContext<'_>)
pub fn is_focused(&self, cx: &WindowContext<'_>) -> bool
Trait Implementations§
source§impl FocusableView for Editor
impl FocusableView for Editor
fn focus_handle(&self, cx: &AppContext) -> FocusHandle
source§impl FollowableItem for Editor
impl FollowableItem for Editor
type FollowableEvent = EditorEvent
fn remote_id(&self) -> Option<ViewId>
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>>>>
fn set_leader_peer_id( &mut self, leader_peer_id: Option<PeerId>, cx: &mut ViewContext<'_, Self> )
fn to_state_proto(&self, cx: &AppContext) -> Option<Variant>
fn add_event_to_update_proto( &self, event: &Self::FollowableEvent, update: &mut Option<Variant>, cx: &AppContext ) -> bool
fn apply_update_proto( &mut self, project: &Model<Project>, message: Variant, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>
fn is_project_item(&self, _cx: &AppContext) -> bool
source§impl InputHandler for Editor
impl InputHandler for Editor
fn text_for_range( &mut self, range_utf16: Range<usize>, cx: &mut ViewContext<'_, Self> ) -> Option<String>
fn selected_text_range( &mut self, cx: &mut ViewContext<'_, Self> ) -> Option<Range<usize>>
fn marked_text_range( &self, cx: &mut ViewContext<'_, Self> ) -> Option<Range<usize>>
fn unmark_text(&mut self, cx: &mut ViewContext<'_, Self>)
fn replace_text_in_range( &mut self, range_utf16: Option<Range<usize>>, text: &str, cx: &mut ViewContext<'_, Self> )
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> )
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
impl Item for Editor
fn tab_tooltip_text(&self, cx: &AppContext) -> Option<SharedString>
fn tab_description<'a>( &self, detail: usize, cx: &'a AppContext ) -> Option<SharedString>
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)
)
fn for_each_project_item( &self, cx: &AppContext, f: &mut dyn FnMut(EntityId, &dyn Item) )
(model id, Item)
fn is_singleton(&self, cx: &AppContext) -> bool
fn clone_on_split( &self, _workspace_id: WorkspaceId, cx: &mut ViewContext<'_, Self> ) -> Option<View<Editor>>where Self: Sized,
fn deactivated(&mut self, cx: &mut ViewContext<'_, Self>)
fn workspace_deactivated(&mut self, cx: &mut ViewContext<'_, Self>)
fn is_dirty(&self, cx: &AppContext) -> bool
fn has_conflict(&self, cx: &AppContext) -> bool
fn can_save(&self, cx: &AppContext) -> bool
fn save( &mut self, project: Model<Project>, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>
fn save_as( &mut self, project: Model<Project>, abs_path: PathBuf, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>
fn reload( &mut self, project: Model<Project>, cx: &mut ViewContext<'_, Self> ) -> Task<Result<()>>
fn as_searchable( &self, handle: &View<Self> ) -> Option<Box<dyn SearchableItemHandle>>
fn pixel_position_of_cursor(&self, _: &AppContext) -> Option<Point<Pixels>>
fn added_to_workspace( &mut self, workspace: &mut Workspace, cx: &mut ViewContext<'_, Self> )
fn serialized_item_kind() -> Option<&'static str>
fn deserialize( project: Model<Project>, _workspace: WeakView<Workspace>, workspace_id: WorkspaceId, item_id: ItemId, cx: &mut ViewContext<'_, Pane> ) -> Task<Result<View<Self>>>
fn act_as_type<'a>( &'a self, type_id: TypeId, self_handle: &'a View<Self>, _: &'a AppContext ) -> Option<AnyView>
fn show_toolbar(&self) -> bool
source§impl ProjectItem for Editor
impl ProjectItem for Editor
source§impl Render for Editor
impl Render for Editor
type Element = EditorElement
fn render(&mut self, cx: &mut ViewContext<'_, Self>) -> Self::Element
source§impl SearchableItem for Editor
impl SearchableItem for Editor
type Match = Range<Anchor>
fn clear_matches(&mut self, cx: &mut ViewContext<'_, Self>)
fn update_matches( &mut self, matches: Vec<Range<Anchor>>, cx: &mut ViewContext<'_, Self> )
fn query_suggestion(&mut self, cx: &mut ViewContext<'_, Self>) -> String
fn activate_match( &mut self, index: usize, matches: Vec<Range<Anchor>>, cx: &mut ViewContext<'_, Self> )
fn select_matches( &mut self, matches: Vec<Self::Match>, cx: &mut ViewContext<'_, Self> )
fn replace( &mut self, identifier: &Self::Match, query: &SearchQuery, cx: &mut ViewContext<'_, Self> )
fn match_index_for_direction( &mut self, matches: &Vec<Range<Anchor>>, current_index: usize, direction: Direction, count: usize, cx: &mut ViewContext<'_, Self> ) -> usize
fn find_matches( &mut self, query: Arc<SearchQuery>, cx: &mut ViewContext<'_, Self> ) -> Task<Vec<Range<Anchor>>>
fn active_match_index( &mut self, matches: Vec<Range<Anchor>>, cx: &mut ViewContext<'_, Self> ) -> Option<usize>
fn supported_options() -> SearchOptions
impl EventEmitter<EditorEvent> for Editor
impl EventEmitter<ItemEvent> for Editor
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> 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