first pass of merging in warp (doesn't build)

This commit is contained in:
Ryan Ward
2026-07-01 16:08:58 -05:00
parent 2f64909469
commit 4770ac06b5
3662 changed files with 414574 additions and 89772 deletions
+37 -18
View File
@@ -5,24 +5,24 @@ use galaxyui::{
};
use itertools::{Either, Itertools};
use line_ending::LineEnding;
use vec1::{Vec1, vec1};
use crate::{
content::{
anchor::Anchor,
buffer::{
AutoScrollBehavior, Buffer, BufferEditAction, BufferSelectAction, EditOrigin,
InitialBufferState, SelectionOffsets, ShouldAutoscroll, ToBufferCharOffset,
},
selection_model::BufferSelectionModel,
text::{BlockType, BufferBlockItem, BufferBlockStyle, CodeBlockType, TextStyles},
version::BufferVersion,
},
render::model::RenderState,
selection::{SelectionMode, SelectionModel, TextDirection, TextUnit},
};
use galaxyui::elements::ListIndentLevel;
use string_offset::{ByteOffset, CharOffset};
use vec1::{Vec1, vec1};
use galaxyui_core::clipboard::ClipboardContent;
use galaxyui_core::elements::ListIndentLevel;
use galaxyui_core::{AppContext, Entity, ModelAsRef, ModelContext, ModelHandle};
use crate::content::anchor::Anchor;
use crate::content::buffer::{
AutoScrollBehavior, Buffer, BufferEditAction, BufferSelectAction, EditOrigin,
InitialBufferState, SelectionOffsets, ShouldAutoscroll, ToBufferCharOffset,
};
use crate::content::selection_model::BufferSelectionModel;
use crate::content::text::{
BlockType, BufferBlockItem, BufferBlockStyle, CodeBlockType, TextStyles,
};
use crate::content::version::BufferVersion;
use crate::render::model::RenderState;
use crate::selection::{SelectionMode, SelectionModel, TextDirection, TextUnit};
/// A wrapper for a buffer that provides access to its internal update_content method.
/// It's important this is only returned from `CoreEditorModel::update_content` method
@@ -917,10 +917,29 @@ pub trait RichTextEditorModel: CoreEditorModel {
self.validate(ctx);
}
fn reset_with_ipynb(&mut self, ipynb: &str, ctx: &mut ModelContext<Self::T>) {
let state = InitialBufferState::ipynb(ipynb);
self.update_content(
|mut content, ctx| {
content.buffer().reset_undo_stack();
content.apply_edit(
BufferEditAction::ReplaceWith(state),
EditOrigin::SystemEdit,
self.buffer_selection_model().clone(),
ctx,
);
},
ctx,
);
self.validate(ctx);
}
fn update_to_new_markdown(&mut self, markdown: &str, ctx: &mut ModelContext<Self::T>) {
use crate::content::buffer::StyledBlockBoundaryBehavior;
use markdown_parser::{compute_formatted_text_delta, parse_markdown};
use crate::content::buffer::StyledBlockBoundaryBehavior;
// Try to obtain the current formatted-text view from the buffer and
// compute both the `FormattedText` delta and the common prefix length in
// characters between the old and new markdown.