Rebrand to Galaxy, major improvements to Bedrock support, still needs some TLC though
This commit is contained in:
@@ -11,18 +11,18 @@ use std::path::Path;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
use std::{cmp, mem};
|
||||
use warp_core::platform::SessionPlatform;
|
||||
use warp_core::send_telemetry_from_ctx;
|
||||
use warp_core::ui::theme::Fill;
|
||||
use warp_editor::content::anchor::Anchor;
|
||||
use warp_editor::content::edit::EditDelta;
|
||||
use warp_editor::content::find::{SearchConfig, SearchResults};
|
||||
use warp_editor::content::selection_model::BufferSelectionModel;
|
||||
use warp_editor::content::version::BufferVersion;
|
||||
use warp_editor::multiline::{AnyMultilineString, MultilineString, LF};
|
||||
use warp_editor::render::model::{AutoScrollMode, LineCount, StyleUpdateAction};
|
||||
use warp_editor::selection::TextDirection;
|
||||
use warpui::units::{IntoPixels, Pixels};
|
||||
use galaxy_core::platform::SessionPlatform;
|
||||
use galaxy_core::send_telemetry_from_ctx;
|
||||
use galaxy_core::ui::theme::Fill;
|
||||
use galaxy_editor::content::anchor::Anchor;
|
||||
use galaxy_editor::content::edit::EditDelta;
|
||||
use galaxy_editor::content::find::{SearchConfig, SearchResults};
|
||||
use galaxy_editor::content::selection_model::BufferSelectionModel;
|
||||
use galaxy_editor::content::version::BufferVersion;
|
||||
use galaxy_editor::multiline::{AnyMultilineString, MultilineString, LF};
|
||||
use galaxy_editor::render::model::{AutoScrollMode, LineCount, StyleUpdateAction};
|
||||
use galaxy_editor::selection::TextDirection;
|
||||
use galaxyui::units::{IntoPixels, Pixels};
|
||||
|
||||
use crate::util::link_detection::get_word_range_at_offset;
|
||||
use crate::{
|
||||
@@ -47,9 +47,9 @@ use vim::{
|
||||
vim_a_quote, vim_a_word, vim_find_char_on_line, vim_find_matching_bracket, vim_inner_block,
|
||||
vim_inner_paragraph, vim_inner_quote, vim_inner_word, vim_word_iterator_from_offset,
|
||||
};
|
||||
use warp_core::semantic_selection::SemanticSelection;
|
||||
use warp_editor::content::buffer::{ShouldAutoscroll, VimInsertPoint};
|
||||
use warp_editor::{
|
||||
use galaxy_core::semantic_selection::SemanticSelection;
|
||||
use galaxy_editor::content::buffer::{ShouldAutoscroll, VimInsertPoint};
|
||||
use galaxy_editor::{
|
||||
content::{
|
||||
buffer::{
|
||||
AutoScrollBehavior, Buffer, BufferEditAction, BufferEvent, BufferSelectAction,
|
||||
@@ -67,12 +67,12 @@ use warp_editor::{
|
||||
},
|
||||
selection::{SelectionMode, SelectionModel, TextUnit},
|
||||
};
|
||||
use warpui::elements::{
|
||||
use galaxyui::elements::{
|
||||
AnchorPair, OffsetPositioning, OffsetType, PositionedElementOffsetBounds, PositioningAxis,
|
||||
XAxisAnchor, YAxisAnchor,
|
||||
};
|
||||
use warpui::text::{point::Point, TextBuffer};
|
||||
use warpui::{AppContext, Entity, ModelContext, ModelHandle, SingletonEntity};
|
||||
use galaxyui::text::{point::Point, TextBuffer};
|
||||
use galaxyui::{AppContext, Entity, ModelContext, ModelHandle, SingletonEntity};
|
||||
|
||||
use super::super::DiffResult;
|
||||
use super::comments::{EditorCommentsModel, PendingComment, PendingCommentEvent};
|
||||
@@ -558,7 +558,7 @@ impl CodeEditorModel {
|
||||
// Set the following line ranges to be hidden in the editor.
|
||||
pub fn set_hidden_lines(
|
||||
&mut self,
|
||||
ranges: RangeSet<warp_editor::content::text::LineCount>,
|
||||
ranges: RangeSet<galaxy_editor::content::text::LineCount>,
|
||||
ctx: &mut ModelContext<Self>,
|
||||
) {
|
||||
self.hidden_lines.update(ctx, |model, ctx| {
|
||||
@@ -573,7 +573,7 @@ impl CodeEditorModel {
|
||||
// Set the following hidden line ranges to be visible. This is no-op if the lines are already visible.
|
||||
pub fn set_visible_line_range(
|
||||
&mut self,
|
||||
range: Range<warp_editor::content::text::LineCount>,
|
||||
range: Range<galaxy_editor::content::text::LineCount>,
|
||||
ctx: &mut ModelContext<Self>,
|
||||
) {
|
||||
let version = self.content().as_ref(ctx).buffer_version();
|
||||
@@ -1293,7 +1293,7 @@ impl CodeEditorModel {
|
||||
let line_count = self.line_count(ctx);
|
||||
|
||||
// Calculate the visible line ranges (with context)
|
||||
let mut visible_ranges: RangeSet<warp_editor::content::text::LineCount> =
|
||||
let mut visible_ranges: RangeSet<galaxy_editor::content::text::LineCount> =
|
||||
RangeSet::new();
|
||||
|
||||
// Add ranges for diffs
|
||||
@@ -1311,14 +1311,14 @@ impl CodeEditorModel {
|
||||
}
|
||||
|
||||
// Calculate hidden ranges as the complement of visible ranges
|
||||
let all_lines: Range<warp_editor::content::text::LineCount> =
|
||||
warp_editor::content::text::LineCount::from(0)
|
||||
..warp_editor::content::text::LineCount::from(line_count);
|
||||
let all_lines: Range<galaxy_editor::content::text::LineCount> =
|
||||
galaxy_editor::content::text::LineCount::from(0)
|
||||
..galaxy_editor::content::text::LineCount::from(line_count);
|
||||
|
||||
// Find gaps in the visible ranges
|
||||
let hidden_ranges = visible_ranges
|
||||
.gaps(&all_lines)
|
||||
.collect::<RangeSet<warp_editor::content::text::LineCount>>();
|
||||
.collect::<RangeSet<galaxy_editor::content::text::LineCount>>();
|
||||
|
||||
self.set_hidden_lines(hidden_ranges, ctx);
|
||||
}
|
||||
@@ -2085,10 +2085,10 @@ impl CodeEditorModel {
|
||||
self.update_content(
|
||||
|mut content, ctx| {
|
||||
content.apply_edit(
|
||||
warp_editor::content::buffer::BufferEditAction::InsertForEachSelection {
|
||||
galaxy_editor::content::buffer::BufferEditAction::InsertForEachSelection {
|
||||
texts: &texts,
|
||||
},
|
||||
warp_editor::content::buffer::EditOrigin::UserTyped,
|
||||
galaxy_editor::content::buffer::EditOrigin::UserTyped,
|
||||
selection_model,
|
||||
ctx,
|
||||
);
|
||||
@@ -2119,10 +2119,10 @@ impl CodeEditorModel {
|
||||
self.update_content(
|
||||
|mut content, ctx| {
|
||||
content.apply_edit(
|
||||
warp_editor::content::buffer::BufferEditAction::InsertAtCharOffsetRanges {
|
||||
galaxy_editor::content::buffer::BufferEditAction::InsertAtCharOffsetRanges {
|
||||
edits: &edits,
|
||||
},
|
||||
warp_editor::content::buffer::EditOrigin::UserTyped,
|
||||
galaxy_editor::content::buffer::EditOrigin::UserTyped,
|
||||
selection_model,
|
||||
ctx,
|
||||
);
|
||||
@@ -3721,10 +3721,10 @@ impl CoreEditorModel for CodeEditorModel {
|
||||
}
|
||||
|
||||
// TODO(kevin): Add validation to the content model.
|
||||
fn validate(&self, _ctx: &impl warpui::ModelAsRef) {}
|
||||
fn validate(&self, _ctx: &impl galaxyui::ModelAsRef) {}
|
||||
|
||||
// Since this is a plain text editor, there is no text styles.
|
||||
fn active_text_style(&self) -> warp_editor::content::text::TextStyles {
|
||||
fn active_text_style(&self) -> galaxy_editor::content::text::TextStyles {
|
||||
Default::default()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user