Fix cursor focus and selection in input box, add AWS env var warning box, and remove AWS Bedrock login banner
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
use std::cmp::Ordering;
|
||||
|
||||
use galaxyui_core::App;
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::SumTree;
|
||||
use galaxyui_core::App;
|
||||
|
||||
use super::{AnchorSide, Anchors};
|
||||
use crate::content::anchor::{Anchor, AnchorUpdate};
|
||||
|
||||
@@ -5,6 +5,14 @@ use std::ops::Range;
|
||||
use std::sync::Arc;
|
||||
|
||||
use enum_iterator::all;
|
||||
use galaxy_core::platform::SessionPlatform;
|
||||
use galaxy_core::safe_error;
|
||||
use galaxy_util::content_version::ContentVersion;
|
||||
use galaxyui_core::elements::ListIndentLevel;
|
||||
use galaxyui_core::fonts::Weight;
|
||||
use galaxyui_core::text::point::Point;
|
||||
use galaxyui_core::text::{TextBuffer, char_slice};
|
||||
use galaxyui_core::{AppContext, Entity, EntityId, ModelContext, ModelHandle};
|
||||
use itertools::{Either, Itertools};
|
||||
use line_ending::LineEnding;
|
||||
use markdown_parser::{
|
||||
@@ -20,14 +28,6 @@ use serde_yaml::Mapping;
|
||||
use string_offset::{ByteOffset, CharOffset};
|
||||
use sum_tree::{SeekBias, SumTree};
|
||||
use vec1::{Vec1, vec1};
|
||||
use galaxy_core::platform::SessionPlatform;
|
||||
use galaxy_core::safe_error;
|
||||
use galaxy_util::content_version::ContentVersion;
|
||||
use galaxyui_core::elements::ListIndentLevel;
|
||||
use galaxyui_core::fonts::Weight;
|
||||
use galaxyui_core::text::point::Point;
|
||||
use galaxyui_core::text::{TextBuffer, char_slice};
|
||||
use galaxyui_core::{AppContext, Entity, EntityId, ModelContext, ModelHandle};
|
||||
|
||||
use super::anchor::{Anchor, AnchorSide, Anchors};
|
||||
use super::cursor::BufferCursor;
|
||||
|
||||
@@ -2,7 +2,10 @@ use std::ops::Range;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicU8, Ordering};
|
||||
|
||||
use galaxy_util::content_version::ContentVersion;
|
||||
use galaxyui::{App, AppContext, ModelContext, ModelHandle, ReadModel};
|
||||
use galaxyui_core::elements::ListIndentLevel;
|
||||
use galaxyui_core::text::point::Point;
|
||||
use line_ending::LineEnding;
|
||||
use markdown_parser::{
|
||||
FormattedIndentTextInline, FormattedText, FormattedTextFragment, FormattedTextLine, parse_html,
|
||||
@@ -14,10 +17,6 @@ use rand::rngs::StdRng;
|
||||
use serde_yaml::{Mapping, Value};
|
||||
use string_offset::{ByteOffset, CharOffset};
|
||||
use vec1::{Vec1, vec1};
|
||||
use galaxy_util::content_version::ContentVersion;
|
||||
use galaxyui_core::elements::ListIndentLevel;
|
||||
use galaxyui_core::text::point::Point;
|
||||
use galaxyui_core::{App, AppContext, ModelContext, ModelHandle, ReadModel};
|
||||
|
||||
use super::{BufferEvent, EditResult, ToBufferCharOffset};
|
||||
use crate::content::buffer::{
|
||||
|
||||
@@ -5,7 +5,6 @@ use galaxyui::elements::ListIndentLevel;
|
||||
use markdown_parser::{FormattedText, FormattedTextFragment, FormattedTextLine};
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::SumTree;
|
||||
use galaxyui_core::elements::ListIndentLevel;
|
||||
|
||||
use super::buffer::{Buffer, EditOrigin, EditResult};
|
||||
use super::cursor::BufferSumTree;
|
||||
|
||||
@@ -5,14 +5,6 @@ use std::ops::Range;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use anyhow::{Result, anyhow};
|
||||
use itertools::Itertools;
|
||||
use markdown_parser::{Hyperlink, TableAlignment};
|
||||
use num_traits::SaturatingSub;
|
||||
use rangemap::RangeSet;
|
||||
use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator};
|
||||
use string_offset::{ByteOffset, CharOffset};
|
||||
use urlocator::{UrlLocation, UrlLocator};
|
||||
use vec1::Vec1;
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxy_core::ui::theme::Fill as ThemeFill;
|
||||
use galaxyui_core::assets::asset_cache::{AssetCache, AssetSource, AssetState};
|
||||
@@ -23,6 +15,14 @@ use galaxyui_core::text::point::Point;
|
||||
use galaxyui_core::text_layout::{StyleAndFont, TextAlignment};
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use galaxyui_core::{AppContext, SingletonEntity};
|
||||
use itertools::Itertools;
|
||||
use markdown_parser::{Hyperlink, TableAlignment};
|
||||
use num_traits::SaturatingSub;
|
||||
use rangemap::RangeSet;
|
||||
use rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator};
|
||||
use string_offset::{ByteOffset, CharOffset};
|
||||
use urlocator::{UrlLocation, UrlLocator};
|
||||
use vec1::Vec1;
|
||||
|
||||
use super::buffer::{StyledBufferBlock, StyledBufferRun, StyledTextBlock};
|
||||
use super::mermaid_diagram::{mermaid_asset_source, mermaid_diagram_layout};
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use std::path::Path;
|
||||
|
||||
use string_offset::CharOffset;
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxyui_core::assets::asset_cache::{AssetCache, AssetSource, AssetState};
|
||||
use galaxyui_core::fonts::{Properties, Style, Weight};
|
||||
use galaxyui_core::image_cache::ImageType;
|
||||
use galaxyui_core::text_layout::{LayoutCache, StyleAndFont, TextStyle};
|
||||
use galaxyui_core::{App, SingletonEntity};
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use super::{
|
||||
BlockLocation, LayOutArgs, layout_mermaid_diagram_block, layout_table_block, layout_text_block,
|
||||
|
||||
@@ -8,7 +8,6 @@ use itertools::Itertools;
|
||||
use rangemap::RangeSet;
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::SumTree;
|
||||
use galaxyui_core::App;
|
||||
|
||||
use super::{Engine, Match, SearchConfig};
|
||||
use crate::content::buffer::Buffer;
|
||||
|
||||
@@ -4,7 +4,6 @@ use std::ops::Range;
|
||||
use galaxyui::{AppContext, Entity, ModelContext, ModelHandle};
|
||||
use rangemap::RangeSet;
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui_core::{AppContext, Entity, ModelContext, ModelHandle};
|
||||
|
||||
use super::anchor::{Anchor, AnchorSide};
|
||||
use crate::content::buffer::Buffer;
|
||||
|
||||
@@ -4,6 +4,9 @@ use std::ops::Range;
|
||||
use std::{io, iter};
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use galaxyui_core::elements::{ListIndentLevel, ListNumbering};
|
||||
use galaxyui_core::text::point::Point;
|
||||
use galaxyui_core::{AppContext, ModelContext, ModelHandle};
|
||||
use html5ever::serialize::{Serialize, Serializer, TraversalScope};
|
||||
use html5ever::{QualName, serialize};
|
||||
use itertools::Itertools;
|
||||
@@ -14,9 +17,6 @@ use markdown_parser::{
|
||||
};
|
||||
use markup5ever::ns;
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui_core::elements::{ListIndentLevel, ListNumbering};
|
||||
use galaxyui_core::text::point::Point;
|
||||
use galaxyui_core::{AppContext, ModelContext, ModelHandle};
|
||||
|
||||
use super::buffer::{
|
||||
ActionWithSelectionDelta, Buffer, EditOrigin, EditResult, StyledBufferBlock,
|
||||
|
||||
@@ -5,7 +5,6 @@ use markdown_parser::{compute_formatted_text_delta, parse_markdown};
|
||||
use serde_yaml::Value;
|
||||
use string_offset::CharOffset;
|
||||
use vec1::Vec1;
|
||||
use galaxyui_core::{App, ReadModel};
|
||||
|
||||
use super::MarkdownStyle;
|
||||
use crate::content::buffer::tests::TestEmbeddedItem;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use galaxyui_core::App;
|
||||
use itertools::Itertools;
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui_core::App;
|
||||
|
||||
use crate::content::buffer::Buffer;
|
||||
use crate::content::outline::BlockOutline;
|
||||
|
||||
@@ -3,11 +3,10 @@
|
||||
//! [`TextBuffer`] API.
|
||||
|
||||
use anyhow::anyhow;
|
||||
use galaxyui::text::{TextBuffer, point::Point, word_boundaries::WordBoundariesPolicy};
|
||||
use galaxyui::text::TextBuffer;
|
||||
use galaxyui::text::point::Point;
|
||||
use galaxyui::text::word_boundaries::WordBoundariesPolicy;
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui_core::text::TextBuffer;
|
||||
use galaxyui_core::text::point::Point;
|
||||
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
|
||||
|
||||
use super::buffer::{Buffer, ToBufferCharOffset, ToBufferPoint};
|
||||
use super::cursor::BufferCursor;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use itertools::Itertools;
|
||||
use markdown_parser::parse_markdown;
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui_core::App;
|
||||
use galaxyui_core::text::TextBuffer;
|
||||
use galaxyui_core::text::point::Point;
|
||||
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
|
||||
use itertools::Itertools;
|
||||
use markdown_parser::parse_markdown;
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use crate::content::buffer::{Buffer, EditOrigin};
|
||||
use crate::content::selection_model::BufferSelectionModel;
|
||||
|
||||
@@ -4,7 +4,6 @@ use galaxyui::{AppContext, Entity, ModelHandle};
|
||||
use itertools::Itertools;
|
||||
use string_offset::CharOffset;
|
||||
use vec1::{Vec1, vec1};
|
||||
use galaxyui_core::{AppContext, Entity, ModelHandle};
|
||||
|
||||
use crate::content::anchor::{Anchor, AnchorSide, AnchorUpdate, Anchors};
|
||||
use crate::content::buffer::{Buffer, SelectionOffsets, ToBufferPoint};
|
||||
|
||||
@@ -8,13 +8,11 @@ use std::sync::{Arc, OnceLock};
|
||||
use arrayvec::ArrayString;
|
||||
use enum_iterator::Sequence;
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxyui::AppContext;
|
||||
use galaxyui::elements::ListIndentLevel;
|
||||
use galaxyui::fonts::{Properties, Style, Weight};
|
||||
use galaxyui::text::BlockHeaderSize as HeaderSize;
|
||||
use galaxyui::text::point::Point;
|
||||
use galaxyui::{
|
||||
AppContext,
|
||||
fonts::{Properties, Style, Weight},
|
||||
};
|
||||
use lazy_static::lazy_static;
|
||||
pub use markdown_parser::markdown_parser::TABLE_BLOCK_MARKDOWN_LANG;
|
||||
use markdown_parser::markdown_parser::{
|
||||
@@ -33,11 +31,6 @@ use rand::Rng;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use string_offset::{ByteOffset, CharOffset, impl_offset};
|
||||
use sum_tree::{Cursor, SeekBias, SumTree};
|
||||
use galaxyui_core::AppContext;
|
||||
use galaxyui_core::elements::ListIndentLevel;
|
||||
use galaxyui_core::fonts::{Properties, Style, Weight};
|
||||
use galaxyui_core::text::BlockHeaderSize as HeaderSize;
|
||||
use galaxyui_core::text::point::Point;
|
||||
|
||||
use super::buffer::Buffer;
|
||||
use super::core::CursorType;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use markdown_parser::{CodeBlockText, FormattedTable};
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxyui_core::fonts::Weight;
|
||||
use markdown_parser::{CodeBlockText, FormattedTable};
|
||||
|
||||
use super::{
|
||||
BufferBlockItem, BufferTextStyle, CodeBlockType, MarkdownStyle, TextStyles,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use sum_tree::SumTree;
|
||||
use galaxyui_core::elements::ListIndentLevel;
|
||||
use sum_tree::SumTree;
|
||||
|
||||
use crate::content::cursor::BufferSumTree;
|
||||
use crate::content::text::{
|
||||
|
||||
@@ -5,13 +5,13 @@ use std::any::Any;
|
||||
use std::cell::Ref;
|
||||
use std::ops::Range;
|
||||
|
||||
use galaxyui_core::elements::Border;
|
||||
use galaxyui_core::text_layout::PaintStyleOverride;
|
||||
use galaxyui_core::{Action, AppContext, Element, TypedActionView, View};
|
||||
use num_traits::SaturatingSub;
|
||||
use pathfinder_color::ColorU;
|
||||
use rangemap::{RangeMap, RangeSet};
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui_core::elements::Border;
|
||||
use galaxyui_core::text_layout::PaintStyleOverride;
|
||||
use galaxyui_core::{Action, AppContext, Element, TypedActionView, View};
|
||||
|
||||
use crate::content::version::BufferVersion;
|
||||
use crate::render::element::RichTextAction;
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
use std::ops::Range;
|
||||
|
||||
use galaxyui::{
|
||||
AppContext, Entity, ModelAsRef, ModelContext, ModelHandle, clipboard::ClipboardContent,
|
||||
};
|
||||
use galaxyui::clipboard::ClipboardContent;
|
||||
use galaxyui::elements::ListIndentLevel;
|
||||
use galaxyui::{AppContext, Entity, ModelAsRef, ModelContext, ModelHandle};
|
||||
use itertools::{Either, Itertools};
|
||||
use line_ending::LineEnding;
|
||||
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::{
|
||||
|
||||
@@ -42,11 +42,10 @@ use std::fmt;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::Deref;
|
||||
|
||||
use galaxy_core::platform::SessionPlatform;
|
||||
use itertools::Itertools as _;
|
||||
use line_ending::LineEnding;
|
||||
|
||||
use galaxy_core::platform::SessionPlatform;
|
||||
|
||||
/// A line ending format. This is the compile-time equivalent to [`LineEnding`].
|
||||
pub trait LineFormat {
|
||||
/// The `LineEnding` corresponding to this format.
|
||||
|
||||
@@ -4,11 +4,6 @@ use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::time::Duration;
|
||||
|
||||
use float_cmp::ApproxEq;
|
||||
use instant::Instant;
|
||||
use parking_lot::Mutex;
|
||||
use string_offset::CharOffset;
|
||||
use temporary_block::RenderableTemporaryBlock;
|
||||
use vim::vim::VimMode;
|
||||
use galaxy_core::ui::theme::Fill as ThemeFill;
|
||||
use galaxyui_core::color::ColorU;
|
||||
use galaxyui_core::elements::new_scrollable::{NewScrollableElement, ScrollableAxis};
|
||||
@@ -24,14 +19,11 @@ use galaxyui_core::{
|
||||
AfterLayoutContext, AppContext, Element, Event, EventContext, LayoutContext, ModelHandle,
|
||||
PaintContext, SizeConstraint, WeakViewHandle,
|
||||
};
|
||||
use std::{
|
||||
fmt,
|
||||
sync::{
|
||||
Arc,
|
||||
atomic::{AtomicBool, Ordering},
|
||||
},
|
||||
time::Duration,
|
||||
};
|
||||
use instant::Instant;
|
||||
use parking_lot::Mutex;
|
||||
use string_offset::CharOffset;
|
||||
use temporary_block::RenderableTemporaryBlock;
|
||||
use vim::vim::VimMode;
|
||||
|
||||
use self::empty::Empty;
|
||||
use self::header::RenderableHeader;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
use std::ops::Range;
|
||||
|
||||
use string_offset::CharOffset;
|
||||
use vim::vim::VimMode;
|
||||
use galaxy_core::ui::appearance::DEFAULT_UI_FONT_SIZE;
|
||||
use galaxyui_core::PaintContext;
|
||||
use galaxyui_core::elements::{CornerRadius, Point, Radius};
|
||||
use galaxyui_core::geometry::rect::RectF;
|
||||
use galaxyui_core::geometry::vector::{Vector2F, vec2f};
|
||||
use galaxyui_core::text_layout::{Line, PaintStyleOverride, TextFrame};
|
||||
use string_offset::CharOffset;
|
||||
use vim::vim::VimMode;
|
||||
|
||||
use crate::editor::TextDecoration;
|
||||
use crate::render::layout::line_height;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use std::ops::Range;
|
||||
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui_core::elements::{
|
||||
Axis, CornerRadius, DEFAULT_SCROLL_WHEEL_PIXELS_PER_LINE, Radius, ScrollData,
|
||||
ScrollbarAppearance, ScrollbarGeometry, ScrollbarWidth, compute_scrollbar_geometry,
|
||||
@@ -11,6 +10,7 @@ use galaxyui_core::geometry::rect::RectF;
|
||||
use galaxyui_core::geometry::vector::{Vector2F, vec2f};
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use galaxyui_core::{AppContext, ClipBounds, Event, EventContext};
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use super::paint::{CursorData, CursorDisplayType};
|
||||
use super::{RenderContext, RenderableBlock};
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use std::cell::Cell;
|
||||
use std::sync::Arc;
|
||||
|
||||
use pathfinder_color::ColorU;
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui_core::elements::{Axis, scroll_delta_for_pointer_movement};
|
||||
use galaxyui_core::fonts::FamilyId;
|
||||
use galaxyui_core::geometry::rect::RectF;
|
||||
use galaxyui_core::geometry::vector::vec2f;
|
||||
use galaxyui_core::text_layout::TextFrame;
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use pathfinder_color::ColorU;
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use crate::content::text::{FormattedTable, table_cell_offset_maps};
|
||||
use crate::render::element::table::{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
use pathfinder_color::ColorU;
|
||||
use galaxyui_core::elements::{
|
||||
Align, Border, ConstrainedBox, Container, CornerRadius, Hoverable, Icon, ListIndentLevel,
|
||||
MouseStateHandle, Radius, Rect,
|
||||
@@ -6,6 +5,7 @@ use galaxyui_core::elements::{
|
||||
use galaxyui_core::geometry::vector::vec2f;
|
||||
use galaxyui_core::platform::Cursor;
|
||||
use galaxyui_core::{AppContext, Element, SizeConstraint, WeakViewHandle};
|
||||
use pathfinder_color::ColorU;
|
||||
|
||||
use super::paint::RenderContext;
|
||||
use super::placeholder::{self, BlockPlaceholder};
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
use std::ops::Range;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[cfg(test)]
|
||||
use markdown_parser::FormattedTextInline;
|
||||
use galaxyui_core::color::ColorU;
|
||||
use galaxyui_core::fonts::TextLayoutSystem;
|
||||
#[cfg(test)]
|
||||
@@ -14,6 +12,8 @@ use galaxyui_core::text_layout::{
|
||||
};
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use galaxyui_core::{AppContext, LayoutContext};
|
||||
#[cfg(test)]
|
||||
use markdown_parser::FormattedTextInline;
|
||||
|
||||
use super::model::{BlockSpacing, ParagraphStyles, RenderState, RichTextStyles};
|
||||
use crate::content::text::{BufferBlockStyle, TextStylesWithMetadata};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//! End-to-end editor tests.
|
||||
|
||||
use string_offset::CharOffset;
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxyui_core::{App, ModelHandle, ReadModel};
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use super::model::test_utils::{TEST_STYLES, init_logging};
|
||||
use super::model::{BlockItem, RenderEvent, RenderState};
|
||||
|
||||
@@ -4,7 +4,6 @@ use galaxyui::units::{IntoPixels, Pixels};
|
||||
use num_traits::SaturatingSub;
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::SeekBias;
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
|
||||
use super::positioned::{Positioned, PositionedCursor};
|
||||
use super::{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
use std::cell::Cell;
|
||||
use std::sync::Arc;
|
||||
|
||||
use pathfinder_color::ColorU;
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::SumTree;
|
||||
use galaxyui_core::assets::asset_cache::AssetSource;
|
||||
use galaxyui_core::fonts::FamilyId;
|
||||
use galaxyui_core::text_layout::{CaretPosition, TextFrame};
|
||||
use galaxyui_core::units::IntoPixels;
|
||||
use pathfinder_color::ColorU;
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::SumTree;
|
||||
|
||||
use crate::content::text::{
|
||||
BufferBlockStyle, CodeBlockType, FormattedTable, table_cell_offset_maps,
|
||||
|
||||
@@ -7,18 +7,6 @@ use std::sync::Arc;
|
||||
use std::{fmt, mem};
|
||||
|
||||
use float_cmp::ApproxEq;
|
||||
use itertools::Itertools;
|
||||
use markdown_parser::TableAlignment;
|
||||
use num_traits::SaturatingSub;
|
||||
use ordered_float::OrderedFloat;
|
||||
use parking_lot::Mutex;
|
||||
use rangemap::RangeSet;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_yaml::Mapping;
|
||||
use string_offset::{CharOffset, impl_offset};
|
||||
use sum_tree::{SeekBias, SumTree};
|
||||
use vec1::Vec1;
|
||||
use vim::vim::{MotionType, VimMode};
|
||||
use galaxy_core::channel::ChannelState;
|
||||
use galaxy_core::ui::Icon;
|
||||
use galaxy_core::ui::theme::Fill as ThemeFill;
|
||||
@@ -38,6 +26,18 @@ use galaxyui_core::text_selection_utils::{
|
||||
};
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use galaxyui_core::{AppContext, Entity, EntityId, ModelContext, ModelHandle};
|
||||
use itertools::Itertools;
|
||||
use markdown_parser::TableAlignment;
|
||||
use num_traits::SaturatingSub;
|
||||
use ordered_float::OrderedFloat;
|
||||
use parking_lot::Mutex;
|
||||
use rangemap::RangeSet;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_yaml::Mapping;
|
||||
use string_offset::{CharOffset, impl_offset};
|
||||
use sum_tree::{SeekBias, SumTree};
|
||||
use vec1::Vec1;
|
||||
use vim::vim::{MotionType, VimMode};
|
||||
|
||||
use self::location::WrapDirection;
|
||||
pub use self::location::{HitTestOptions, Location};
|
||||
@@ -2241,10 +2241,7 @@ impl RenderState {
|
||||
} else {
|
||||
0
|
||||
};
|
||||
loop {
|
||||
let Some(item) = cursor.positioned_item() else {
|
||||
break;
|
||||
};
|
||||
while let Some(item) = cursor.positioned_item() {
|
||||
if item.start_line != previous_line {
|
||||
index_within_line = 0;
|
||||
} else {
|
||||
@@ -3190,9 +3187,11 @@ impl RenderState {
|
||||
self.reveal_offset_in_table(*character_offset)
|
||||
}
|
||||
AutoScrollMode::ScrollToActiveSelections { .. } => {
|
||||
self.selections().iter().fold(false, |changed, selection| {
|
||||
self.reveal_offset_in_table(selection.head) || changed
|
||||
})
|
||||
let mut changed = false;
|
||||
for selection in self.selections().iter() {
|
||||
changed = self.reveal_offset_in_table(selection.head) || changed;
|
||||
}
|
||||
changed
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
use std::cell::Cell;
|
||||
use std::sync::Arc;
|
||||
|
||||
use markdown_parser::{FormattedTextStyles, Hyperlink};
|
||||
use rangemap::RangeSet;
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::SumTree;
|
||||
use vec1::{Vec1, vec1};
|
||||
use galaxyui_core::assets::asset_cache::AssetSource;
|
||||
use galaxyui_core::color::ColorU;
|
||||
use galaxyui_core::elements::ListIndentLevel;
|
||||
@@ -14,6 +9,11 @@ use galaxyui_core::geometry::rect::RectF;
|
||||
use galaxyui_core::geometry::vector::vec2f;
|
||||
use galaxyui_core::text_layout::TextFrame;
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use markdown_parser::{FormattedTextStyles, Hyperlink};
|
||||
use rangemap::RangeSet;
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::SumTree;
|
||||
use vec1::{Vec1, vec1};
|
||||
|
||||
use super::debug::Describe;
|
||||
use super::test_utils::{layout_paragraph, layout_paragraphs};
|
||||
@@ -1433,6 +1433,8 @@ fn test_link_at_offset_uses_cached_cell_links() {
|
||||
|
||||
mod char_cell {
|
||||
|
||||
use string_offset::CharOffset;
|
||||
|
||||
use crate::render::model::{
|
||||
ColumnUnit, LineCount, SoftWrapPoint, char_cell_display_width, char_cell_line_row_starts,
|
||||
char_cell_max_line, char_cell_offset_to_softwrap_point, char_cell_softwrap_point_to_offset,
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
|
||||
use std::sync::Arc;
|
||||
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::{Cursor, Dimension};
|
||||
use galaxyui_core::geometry::vector::Vector2F;
|
||||
use galaxyui_core::text_layout::Line;
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::{Cursor, Dimension};
|
||||
|
||||
use super::{
|
||||
BlockItem, BlockSpacing, HorizontalRuleConfig, ImageBlockConfig, LaidOutEmbeddedItem,
|
||||
|
||||
@@ -3,15 +3,15 @@
|
||||
use std::mem;
|
||||
use std::sync::Arc;
|
||||
|
||||
use ordered_float::OrderedFloat;
|
||||
use parking_lot::Once;
|
||||
use vec1::{Vec1, vec1};
|
||||
use galaxyui_core::color::ColorU;
|
||||
use galaxyui_core::elements::{Border, Fill, ListIndentLevel};
|
||||
use galaxyui_core::fonts::{FamilyId, Weight};
|
||||
use galaxyui_core::geometry::vector::vec2f;
|
||||
use galaxyui_core::text_layout::{CaretPosition, Glyph, Line, Run, TextFrame};
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use ordered_float::OrderedFloat;
|
||||
use parking_lot::Once;
|
||||
use vec1::{Vec1, vec1};
|
||||
|
||||
use super::{
|
||||
BlockItem, BrokenLinkStyle, CheckBoxStyle, DEFAULT_BLOCK_SPACINGS, HorizontalRuleStyle,
|
||||
@@ -310,12 +310,12 @@ pub fn layout(text: &str, styles: &RichTextStyles, max_width: impl IntoPixels) -
|
||||
|
||||
/// Initialize logging for tests. This should be called at the start of any test that needs logging.
|
||||
pub fn init_logging() {
|
||||
// If multiple tests run in the same process, we should still only set up logging once.
|
||||
static INIT: Once = Once::new();
|
||||
INIT.call_once(|| {
|
||||
env_logger::builder()
|
||||
let _ = env_logger::builder()
|
||||
.parse_filters("galaxy_editor=trace")
|
||||
.is_test(true)
|
||||
.init();
|
||||
.try_init();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use float_cmp::ApproxEq;
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::{SeekBias, SumTree};
|
||||
use galaxyui_core::SizeConstraint;
|
||||
use galaxyui_core::geometry::rect::RectF;
|
||||
use galaxyui_core::geometry::vector::{Vector2F, vec2f};
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::{SeekBias, SumTree};
|
||||
|
||||
use super::positioned::PositionedCursor;
|
||||
use super::{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use itertools::Itertools;
|
||||
use sum_tree::SumTree;
|
||||
use galaxyui_core::SizeConstraint;
|
||||
use galaxyui_core::geometry::vector::vec2f;
|
||||
use galaxyui_core::units::{IntoPixels, Pixels};
|
||||
use itertools::Itertools;
|
||||
use sum_tree::SumTree;
|
||||
|
||||
use super::ViewportState;
|
||||
use crate::render::model::RenderState;
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
use std::ops::Range;
|
||||
|
||||
use galaxy_core::ui::theme::Fill;
|
||||
use galaxyui::{Entity, ModelContext, ModelHandle, r#async::SpawnedFutureHandle};
|
||||
use galaxyui::r#async::SpawnedFutureHandle;
|
||||
use galaxyui::{Entity, ModelContext, ModelHandle};
|
||||
use itertools::Itertools;
|
||||
use lazy_static::lazy_static;
|
||||
use pathfinder_color::ColorU;
|
||||
use string_offset::CharOffset;
|
||||
use galaxyui_core::r#async::SpawnedFutureHandle;
|
||||
use galaxyui_core::{Entity, ModelContext, ModelHandle};
|
||||
|
||||
use crate::content::anchor::Anchor;
|
||||
use crate::content::buffer::{Buffer, BufferEvent};
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
use std::ops::Range;
|
||||
|
||||
use num_traits::SaturatingSub;
|
||||
use string_offset::CharOffset;
|
||||
use vec1::Vec1;
|
||||
use galaxyui_core::text::TextBuffer;
|
||||
use galaxyui_core::text::point::Point;
|
||||
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
|
||||
use galaxyui_core::{AppContext, Entity, ModelAsRef, ModelContext, ModelHandle};
|
||||
use num_traits::SaturatingSub;
|
||||
use string_offset::CharOffset;
|
||||
use vec1::Vec1;
|
||||
|
||||
use crate::content::buffer::{
|
||||
AutoScrollBehavior, Buffer, BufferEvent, BufferSelectAction, SelectionOffsets,
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxyui::{App, ModelAsRef, units::IntoPixels};
|
||||
use galaxyui::units::IntoPixels;
|
||||
use galaxyui::{App, ModelAsRef};
|
||||
use galaxyui_core::assets::asset_cache::AssetSource;
|
||||
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
|
||||
use serde_yaml::Value;
|
||||
use string_offset::CharOffset;
|
||||
use sum_tree::SumTree;
|
||||
use vec1::vec1;
|
||||
use galaxyui_core::assets::asset_cache::AssetSource;
|
||||
use galaxyui_core::text::word_boundaries::WordBoundariesPolicy;
|
||||
use galaxyui_core::units::IntoPixels;
|
||||
use galaxyui_core::{App, ModelAsRef};
|
||||
|
||||
use super::{SelectionModel, TextDirection, TextUnit};
|
||||
use crate::content::buffer::tests::TestEmbeddedItem;
|
||||
|
||||
Reference in New Issue
Block a user