Merge remote-tracking branch 'origin/main' into editor2-rename
# Conflicts: # crates/editor2/src/editor.rs # crates/editor2/src/element.rs # crates/gpui2/src/style.rs
This commit is contained in:
commit
feeb44c122
103 changed files with 7489 additions and 4864 deletions
|
@ -20,9 +20,9 @@ use collections::{BTreeMap, HashMap};
|
|||
use gpui::{
|
||||
point, px, relative, size, transparent_black, Action, AnyElement, AvailableSpace, BorrowWindow,
|
||||
Bounds, Component, ContentMask, Corners, DispatchPhase, Edges, Element, ElementId,
|
||||
ElementInputHandler, Entity, Hsla, Line, MouseButton, MouseDownEvent, MouseMoveEvent,
|
||||
MouseUpEvent, ParentElement, Pixels, ScrollWheelEvent, Size, Style, Styled, TextRun, TextStyle,
|
||||
ViewContext, WindowContext,
|
||||
ElementInputHandler, Entity, EntityId, Hsla, Line, MouseButton, MouseDownEvent, MouseMoveEvent,
|
||||
MouseUpEvent, ParentComponent, Pixels, ScrollWheelEvent, Size, Style, Styled, TextRun,
|
||||
TextStyle, View, ViewContext, WindowContext,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use language::language_settings::ShowWhitespaceSetting;
|
||||
|
@ -111,12 +111,16 @@ impl SelectionLayout {
|
|||
}
|
||||
|
||||
pub struct EditorElement {
|
||||
editor_id: EntityId,
|
||||
style: EditorStyle,
|
||||
}
|
||||
|
||||
impl EditorElement {
|
||||
pub fn new(style: EditorStyle) -> Self {
|
||||
Self { style }
|
||||
pub fn new(editor: &View<Editor>, style: EditorStyle) -> Self {
|
||||
Self {
|
||||
editor_id: editor.entity_id(),
|
||||
style,
|
||||
}
|
||||
}
|
||||
|
||||
fn mouse_down(
|
||||
|
@ -622,7 +626,7 @@ impl EditorElement {
|
|||
let line_end_overshoot = 0.15 * layout.position_map.line_height;
|
||||
let whitespace_setting = editor.buffer.read(cx).settings_at(0, cx).show_whitespaces;
|
||||
|
||||
cx.with_content_mask(ContentMask { bounds }, |cx| {
|
||||
cx.with_content_mask(Some(ContentMask { bounds }), |cx| {
|
||||
// todo!("cursor region")
|
||||
// cx.scene().push_cursor_region(CursorRegion {
|
||||
// bounds,
|
||||
|
@ -1448,6 +1452,7 @@ impl EditorElement {
|
|||
|
||||
let snapshot = editor.snapshot(cx);
|
||||
let style = self.style.clone();
|
||||
|
||||
let font_id = cx.text_system().font_id(&style.text.font()).unwrap();
|
||||
let font_size = style.text.font_size.to_pixels(cx.rem_size());
|
||||
let line_height = style.text.line_height_in_pixels(cx.rem_size());
|
||||
|
@ -2399,8 +2404,8 @@ enum Invisible {
|
|||
impl Element<Editor> for EditorElement {
|
||||
type ElementState = ();
|
||||
|
||||
fn id(&self) -> Option<gpui::ElementId> {
|
||||
None
|
||||
fn element_id(&self) -> Option<gpui::ElementId> {
|
||||
Some(self.editor_id.into())
|
||||
}
|
||||
|
||||
fn initialize(
|
||||
|
@ -2410,186 +2415,6 @@ impl Element<Editor> for EditorElement {
|
|||
cx: &mut gpui::ViewContext<Editor>,
|
||||
) -> Self::ElementState {
|
||||
editor.style = Some(self.style.clone()); // Long-term, we'd like to eliminate this.
|
||||
|
||||
let dispatch_context = editor.dispatch_context(cx);
|
||||
cx.with_element_id(cx.view().entity_id(), |global_id, cx| {
|
||||
cx.with_key_dispatch(
|
||||
dispatch_context,
|
||||
Some(editor.focus_handle.clone()),
|
||||
|_, cx| {
|
||||
register_action(cx, Editor::move_left);
|
||||
register_action(cx, Editor::move_right);
|
||||
register_action(cx, Editor::move_down);
|
||||
register_action(cx, Editor::move_up);
|
||||
// on_action(cx, Editor::new_file); todo!()
|
||||
// on_action(cx, Editor::new_file_in_direction); todo!()
|
||||
register_action(cx, Editor::cancel);
|
||||
register_action(cx, Editor::newline);
|
||||
register_action(cx, Editor::newline_above);
|
||||
register_action(cx, Editor::newline_below);
|
||||
register_action(cx, Editor::backspace);
|
||||
register_action(cx, Editor::delete);
|
||||
register_action(cx, Editor::tab);
|
||||
register_action(cx, Editor::tab_prev);
|
||||
register_action(cx, Editor::indent);
|
||||
register_action(cx, Editor::outdent);
|
||||
register_action(cx, Editor::delete_line);
|
||||
register_action(cx, Editor::join_lines);
|
||||
register_action(cx, Editor::sort_lines_case_sensitive);
|
||||
register_action(cx, Editor::sort_lines_case_insensitive);
|
||||
register_action(cx, Editor::reverse_lines);
|
||||
register_action(cx, Editor::shuffle_lines);
|
||||
register_action(cx, Editor::convert_to_upper_case);
|
||||
register_action(cx, Editor::convert_to_lower_case);
|
||||
register_action(cx, Editor::convert_to_title_case);
|
||||
register_action(cx, Editor::convert_to_snake_case);
|
||||
register_action(cx, Editor::convert_to_kebab_case);
|
||||
register_action(cx, Editor::convert_to_upper_camel_case);
|
||||
register_action(cx, Editor::convert_to_lower_camel_case);
|
||||
register_action(cx, Editor::delete_to_previous_word_start);
|
||||
register_action(cx, Editor::delete_to_previous_subword_start);
|
||||
register_action(cx, Editor::delete_to_next_word_end);
|
||||
register_action(cx, Editor::delete_to_next_subword_end);
|
||||
register_action(cx, Editor::delete_to_beginning_of_line);
|
||||
register_action(cx, Editor::delete_to_end_of_line);
|
||||
register_action(cx, Editor::cut_to_end_of_line);
|
||||
register_action(cx, Editor::duplicate_line);
|
||||
register_action(cx, Editor::move_line_up);
|
||||
register_action(cx, Editor::move_line_down);
|
||||
register_action(cx, Editor::transpose);
|
||||
register_action(cx, Editor::cut);
|
||||
register_action(cx, Editor::copy);
|
||||
register_action(cx, Editor::paste);
|
||||
register_action(cx, Editor::undo);
|
||||
register_action(cx, Editor::redo);
|
||||
register_action(cx, Editor::move_page_up);
|
||||
register_action(cx, Editor::move_page_down);
|
||||
register_action(cx, Editor::next_screen);
|
||||
register_action(cx, Editor::scroll_cursor_top);
|
||||
register_action(cx, Editor::scroll_cursor_center);
|
||||
register_action(cx, Editor::scroll_cursor_bottom);
|
||||
register_action(cx, |editor, _: &LineDown, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Line(1.), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &LineUp, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Line(-1.), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &HalfPageDown, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Page(0.5), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &HalfPageUp, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Page(-0.5), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &PageDown, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Page(1.), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &PageUp, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Page(-1.), cx)
|
||||
});
|
||||
register_action(cx, Editor::move_to_previous_word_start);
|
||||
register_action(cx, Editor::move_to_previous_subword_start);
|
||||
register_action(cx, Editor::move_to_next_word_end);
|
||||
register_action(cx, Editor::move_to_next_subword_end);
|
||||
register_action(cx, Editor::move_to_beginning_of_line);
|
||||
register_action(cx, Editor::move_to_end_of_line);
|
||||
register_action(cx, Editor::move_to_start_of_paragraph);
|
||||
register_action(cx, Editor::move_to_end_of_paragraph);
|
||||
register_action(cx, Editor::move_to_beginning);
|
||||
register_action(cx, Editor::move_to_end);
|
||||
register_action(cx, Editor::select_up);
|
||||
register_action(cx, Editor::select_down);
|
||||
register_action(cx, Editor::select_left);
|
||||
register_action(cx, Editor::select_right);
|
||||
register_action(cx, Editor::select_to_previous_word_start);
|
||||
register_action(cx, Editor::select_to_previous_subword_start);
|
||||
register_action(cx, Editor::select_to_next_word_end);
|
||||
register_action(cx, Editor::select_to_next_subword_end);
|
||||
register_action(cx, Editor::select_to_beginning_of_line);
|
||||
register_action(cx, Editor::select_to_end_of_line);
|
||||
register_action(cx, Editor::select_to_start_of_paragraph);
|
||||
register_action(cx, Editor::select_to_end_of_paragraph);
|
||||
register_action(cx, Editor::select_to_beginning);
|
||||
register_action(cx, Editor::select_to_end);
|
||||
register_action(cx, Editor::select_all);
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor.select_all_matches(action, cx).log_err();
|
||||
});
|
||||
register_action(cx, Editor::select_line);
|
||||
register_action(cx, Editor::split_selection_into_lines);
|
||||
register_action(cx, Editor::add_selection_above);
|
||||
register_action(cx, Editor::add_selection_below);
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor.select_next(action, cx).log_err();
|
||||
});
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor.select_previous(action, cx).log_err();
|
||||
});
|
||||
register_action(cx, Editor::toggle_comments);
|
||||
register_action(cx, Editor::select_larger_syntax_node);
|
||||
register_action(cx, Editor::select_smaller_syntax_node);
|
||||
register_action(cx, Editor::move_to_enclosing_bracket);
|
||||
register_action(cx, Editor::undo_selection);
|
||||
register_action(cx, Editor::redo_selection);
|
||||
register_action(cx, Editor::go_to_diagnostic);
|
||||
register_action(cx, Editor::go_to_prev_diagnostic);
|
||||
register_action(cx, Editor::go_to_hunk);
|
||||
register_action(cx, Editor::go_to_prev_hunk);
|
||||
register_action(cx, Editor::go_to_definition);
|
||||
register_action(cx, Editor::go_to_definition_split);
|
||||
register_action(cx, Editor::go_to_type_definition);
|
||||
register_action(cx, Editor::go_to_type_definition_split);
|
||||
register_action(cx, Editor::fold);
|
||||
register_action(cx, Editor::fold_at);
|
||||
register_action(cx, Editor::unfold_lines);
|
||||
register_action(cx, Editor::unfold_at);
|
||||
register_action(cx, Editor::fold_selected_ranges);
|
||||
register_action(cx, Editor::show_completions);
|
||||
register_action(cx, Editor::toggle_code_actions);
|
||||
// on_action(cx, Editor::open_excerpts); todo!()
|
||||
register_action(cx, Editor::toggle_soft_wrap);
|
||||
register_action(cx, Editor::toggle_inlay_hints);
|
||||
register_action(cx, Editor::reveal_in_finder);
|
||||
register_action(cx, Editor::copy_path);
|
||||
register_action(cx, Editor::copy_relative_path);
|
||||
register_action(cx, Editor::copy_highlight_json);
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.format(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, Editor::restart_language_server);
|
||||
register_action(cx, Editor::show_character_palette);
|
||||
// on_action(cx, Editor::confirm_completion); todo!()
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.confirm_code_action(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.rename(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.confirm_rename(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.find_all_references(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, Editor::next_copilot_suggestion);
|
||||
register_action(cx, Editor::previous_copilot_suggestion);
|
||||
register_action(cx, Editor::copilot_suggest);
|
||||
register_action(cx, Editor::context_menu_first);
|
||||
register_action(cx, Editor::context_menu_prev);
|
||||
register_action(cx, Editor::context_menu_next);
|
||||
register_action(cx, Editor::context_menu_last);
|
||||
},
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
fn layout(
|
||||
|
@ -2626,32 +2451,208 @@ impl Element<Editor> for EditorElement {
|
|||
size: layout.text_size,
|
||||
};
|
||||
|
||||
// We call with_z_index to establish a new stacking context.
|
||||
cx.with_z_index(0, |cx| {
|
||||
cx.with_content_mask(ContentMask { bounds }, |cx| {
|
||||
self.paint_mouse_listeners(
|
||||
bounds,
|
||||
gutter_bounds,
|
||||
text_bounds,
|
||||
&layout.position_map,
|
||||
cx,
|
||||
);
|
||||
let dispatch_context = editor.dispatch_context(cx);
|
||||
cx.with_key_dispatch(
|
||||
dispatch_context,
|
||||
Some(editor.focus_handle.clone()),
|
||||
|_, cx| {
|
||||
register_action(cx, Editor::move_left);
|
||||
register_action(cx, Editor::move_right);
|
||||
register_action(cx, Editor::move_down);
|
||||
register_action(cx, Editor::move_up);
|
||||
// on_action(cx, Editor::new_file); todo!()
|
||||
// on_action(cx, Editor::new_file_in_direction); todo!()
|
||||
register_action(cx, Editor::cancel);
|
||||
register_action(cx, Editor::newline);
|
||||
register_action(cx, Editor::newline_above);
|
||||
register_action(cx, Editor::newline_below);
|
||||
register_action(cx, Editor::backspace);
|
||||
register_action(cx, Editor::delete);
|
||||
register_action(cx, Editor::tab);
|
||||
register_action(cx, Editor::tab_prev);
|
||||
register_action(cx, Editor::indent);
|
||||
register_action(cx, Editor::outdent);
|
||||
register_action(cx, Editor::delete_line);
|
||||
register_action(cx, Editor::join_lines);
|
||||
register_action(cx, Editor::sort_lines_case_sensitive);
|
||||
register_action(cx, Editor::sort_lines_case_insensitive);
|
||||
register_action(cx, Editor::reverse_lines);
|
||||
register_action(cx, Editor::shuffle_lines);
|
||||
register_action(cx, Editor::convert_to_upper_case);
|
||||
register_action(cx, Editor::convert_to_lower_case);
|
||||
register_action(cx, Editor::convert_to_title_case);
|
||||
register_action(cx, Editor::convert_to_snake_case);
|
||||
register_action(cx, Editor::convert_to_kebab_case);
|
||||
register_action(cx, Editor::convert_to_upper_camel_case);
|
||||
register_action(cx, Editor::convert_to_lower_camel_case);
|
||||
register_action(cx, Editor::delete_to_previous_word_start);
|
||||
register_action(cx, Editor::delete_to_previous_subword_start);
|
||||
register_action(cx, Editor::delete_to_next_word_end);
|
||||
register_action(cx, Editor::delete_to_next_subword_end);
|
||||
register_action(cx, Editor::delete_to_beginning_of_line);
|
||||
register_action(cx, Editor::delete_to_end_of_line);
|
||||
register_action(cx, Editor::cut_to_end_of_line);
|
||||
register_action(cx, Editor::duplicate_line);
|
||||
register_action(cx, Editor::move_line_up);
|
||||
register_action(cx, Editor::move_line_down);
|
||||
register_action(cx, Editor::transpose);
|
||||
register_action(cx, Editor::cut);
|
||||
register_action(cx, Editor::copy);
|
||||
register_action(cx, Editor::paste);
|
||||
register_action(cx, Editor::undo);
|
||||
register_action(cx, Editor::redo);
|
||||
register_action(cx, Editor::move_page_up);
|
||||
register_action(cx, Editor::move_page_down);
|
||||
register_action(cx, Editor::next_screen);
|
||||
register_action(cx, Editor::scroll_cursor_top);
|
||||
register_action(cx, Editor::scroll_cursor_center);
|
||||
register_action(cx, Editor::scroll_cursor_bottom);
|
||||
register_action(cx, |editor, _: &LineDown, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Line(1.), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &LineUp, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Line(-1.), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &HalfPageDown, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Page(0.5), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &HalfPageUp, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Page(-0.5), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &PageDown, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Page(1.), cx)
|
||||
});
|
||||
register_action(cx, |editor, _: &PageUp, cx| {
|
||||
editor.scroll_screen(&ScrollAmount::Page(-1.), cx)
|
||||
});
|
||||
register_action(cx, Editor::move_to_previous_word_start);
|
||||
register_action(cx, Editor::move_to_previous_subword_start);
|
||||
register_action(cx, Editor::move_to_next_word_end);
|
||||
register_action(cx, Editor::move_to_next_subword_end);
|
||||
register_action(cx, Editor::move_to_beginning_of_line);
|
||||
register_action(cx, Editor::move_to_end_of_line);
|
||||
register_action(cx, Editor::move_to_start_of_paragraph);
|
||||
register_action(cx, Editor::move_to_end_of_paragraph);
|
||||
register_action(cx, Editor::move_to_beginning);
|
||||
register_action(cx, Editor::move_to_end);
|
||||
register_action(cx, Editor::select_up);
|
||||
register_action(cx, Editor::select_down);
|
||||
register_action(cx, Editor::select_left);
|
||||
register_action(cx, Editor::select_right);
|
||||
register_action(cx, Editor::select_to_previous_word_start);
|
||||
register_action(cx, Editor::select_to_previous_subword_start);
|
||||
register_action(cx, Editor::select_to_next_word_end);
|
||||
register_action(cx, Editor::select_to_next_subword_end);
|
||||
register_action(cx, Editor::select_to_beginning_of_line);
|
||||
register_action(cx, Editor::select_to_end_of_line);
|
||||
register_action(cx, Editor::select_to_start_of_paragraph);
|
||||
register_action(cx, Editor::select_to_end_of_paragraph);
|
||||
register_action(cx, Editor::select_to_beginning);
|
||||
register_action(cx, Editor::select_to_end);
|
||||
register_action(cx, Editor::select_all);
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor.select_all_matches(action, cx).log_err();
|
||||
});
|
||||
register_action(cx, Editor::select_line);
|
||||
register_action(cx, Editor::split_selection_into_lines);
|
||||
register_action(cx, Editor::add_selection_above);
|
||||
register_action(cx, Editor::add_selection_below);
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor.select_next(action, cx).log_err();
|
||||
});
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor.select_previous(action, cx).log_err();
|
||||
});
|
||||
register_action(cx, Editor::toggle_comments);
|
||||
register_action(cx, Editor::select_larger_syntax_node);
|
||||
register_action(cx, Editor::select_smaller_syntax_node);
|
||||
register_action(cx, Editor::move_to_enclosing_bracket);
|
||||
register_action(cx, Editor::undo_selection);
|
||||
register_action(cx, Editor::redo_selection);
|
||||
register_action(cx, Editor::go_to_diagnostic);
|
||||
register_action(cx, Editor::go_to_prev_diagnostic);
|
||||
register_action(cx, Editor::go_to_hunk);
|
||||
register_action(cx, Editor::go_to_prev_hunk);
|
||||
register_action(cx, Editor::go_to_definition);
|
||||
register_action(cx, Editor::go_to_definition_split);
|
||||
register_action(cx, Editor::go_to_type_definition);
|
||||
register_action(cx, Editor::go_to_type_definition_split);
|
||||
register_action(cx, Editor::fold);
|
||||
register_action(cx, Editor::fold_at);
|
||||
register_action(cx, Editor::unfold_lines);
|
||||
register_action(cx, Editor::unfold_at);
|
||||
register_action(cx, Editor::fold_selected_ranges);
|
||||
register_action(cx, Editor::show_completions);
|
||||
register_action(cx, Editor::toggle_code_actions);
|
||||
// on_action(cx, Editor::open_excerpts); todo!()
|
||||
register_action(cx, Editor::toggle_soft_wrap);
|
||||
register_action(cx, Editor::toggle_inlay_hints);
|
||||
register_action(cx, Editor::reveal_in_finder);
|
||||
register_action(cx, Editor::copy_path);
|
||||
register_action(cx, Editor::copy_relative_path);
|
||||
register_action(cx, Editor::copy_highlight_json);
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.format(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, Editor::restart_language_server);
|
||||
register_action(cx, Editor::show_character_palette);
|
||||
// on_action(cx, Editor::confirm_completion); todo!()
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.confirm_code_action(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.rename(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.confirm_rename(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, |editor, action, cx| {
|
||||
editor
|
||||
.find_all_references(action, cx)
|
||||
.map(|task| task.detach_and_log_err(cx));
|
||||
});
|
||||
register_action(cx, Editor::next_copilot_suggestion);
|
||||
register_action(cx, Editor::previous_copilot_suggestion);
|
||||
register_action(cx, Editor::copilot_suggest);
|
||||
register_action(cx, Editor::context_menu_first);
|
||||
register_action(cx, Editor::context_menu_prev);
|
||||
register_action(cx, Editor::context_menu_next);
|
||||
register_action(cx, Editor::context_menu_last);
|
||||
|
||||
self.paint_background(gutter_bounds, text_bounds, &layout, cx);
|
||||
if layout.gutter_size.width > Pixels::ZERO {
|
||||
self.paint_gutter(gutter_bounds, &mut layout, editor, cx);
|
||||
}
|
||||
// We call with_z_index to establish a new stacking context.
|
||||
cx.with_z_index(0, |cx| {
|
||||
cx.with_content_mask(Some(ContentMask { bounds }), |cx| {
|
||||
self.paint_mouse_listeners(
|
||||
bounds,
|
||||
gutter_bounds,
|
||||
text_bounds,
|
||||
&layout.position_map,
|
||||
cx,
|
||||
);
|
||||
self.paint_background(gutter_bounds, text_bounds, &layout, cx);
|
||||
if layout.gutter_size.width > Pixels::ZERO {
|
||||
self.paint_gutter(gutter_bounds, &mut layout, editor, cx);
|
||||
}
|
||||
self.paint_text(text_bounds, &mut layout, editor, cx);
|
||||
|
||||
self.paint_text(text_bounds, &mut layout, editor, cx);
|
||||
if !layout.blocks.is_empty() {
|
||||
self.paint_blocks(bounds, &mut layout, editor, cx);
|
||||
}
|
||||
|
||||
if !layout.blocks.is_empty() {
|
||||
self.paint_blocks(bounds, &mut layout, editor, cx);
|
||||
}
|
||||
|
||||
let input_handler = ElementInputHandler::new(bounds, cx);
|
||||
cx.handle_input(&editor.focus_handle, input_handler);
|
||||
});
|
||||
});
|
||||
let input_handler = ElementInputHandler::new(bounds, cx);
|
||||
cx.handle_input(&editor.focus_handle, input_handler);
|
||||
});
|
||||
});
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue