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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user