first pass of merging in warp (doesn't build)
This commit is contained in:
@@ -1,34 +1,30 @@
|
||||
use std::{cell::RefCell, collections::HashMap};
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxyui::{
|
||||
elements::{Flex, MouseStateHandle, ParentElement},
|
||||
ui_components::{components::UiComponent, switch::SwitchStateHandle},
|
||||
Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle,
|
||||
};
|
||||
use settings::{Setting, ToggleableSetting};
|
||||
use galaxy_core::features::FeatureFlag;
|
||||
use galaxyui::elements::{Flex, MouseStateHandle, ParentElement};
|
||||
use galaxyui::ui_components::components::UiComponent;
|
||||
use galaxyui::ui_components::switch::SwitchStateHandle;
|
||||
use galaxyui::{Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle};
|
||||
|
||||
use crate::{
|
||||
appearance::Appearance,
|
||||
report_if_error, send_telemetry_from_ctx,
|
||||
server::telemetry::TelemetryEvent,
|
||||
settings_view::settings_page::{
|
||||
render_body_item, render_dropdown_item, AdditionalInfo, LocalOnlyIconState, ToggleState,
|
||||
},
|
||||
util::file::external_editor::{
|
||||
settings::{
|
||||
EditorChoice, EditorLayout, OpenCodePanelsFileEditor, OpenFileEditor, OpenFileLayout,
|
||||
PreferMarkdownViewer, PreferTabbedEditorView,
|
||||
},
|
||||
EditorSettings, SUPPORTED_EDITORS,
|
||||
},
|
||||
view_components::{Dropdown, DropdownItem},
|
||||
use crate::appearance::Appearance;
|
||||
use crate::server::telemetry::TelemetryEvent;
|
||||
use crate::settings_view::settings_page::{
|
||||
render_body_item, render_dropdown_item, AdditionalInfo, LocalOnlyIconState, ToggleState,
|
||||
};
|
||||
use crate::util::file::external_editor::settings::{
|
||||
EditorChoice, EditorLayout, OpenCodePanelsFileEditor, OpenFileEditor, OpenFileLayout,
|
||||
PreferMarkdownViewer, PreferTabbedEditorView,
|
||||
};
|
||||
use crate::util::file::external_editor::{EditorSettings, SUPPORTED_EDITORS};
|
||||
use crate::view_components::{Dropdown, DropdownItem};
|
||||
use crate::{report_if_error, send_telemetry_from_ctx};
|
||||
|
||||
const TABBED_FILE_VIEWER_TOGGLE_HEADER: &str = "Group files into single editor pane";
|
||||
const TABBED_FILE_VIEWER_TOGGLE_DESCRIPTION: &str = "When this setting is on, any files opened in the same tab will be automatically grouped into a single editor pane.";
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum ExternalEditorAction {
|
||||
SetEditor(EditorChoice),
|
||||
SetCodePanelsEditor(EditorChoice),
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
use galaxyui::{
|
||||
elements::{CrossAxisAlignment, Fill, Flex, ParentElement, Shrinkable},
|
||||
presenter::ChildView,
|
||||
ui_components::components::{Coords, UiComponent, UiComponentStyles},
|
||||
Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle,
|
||||
};
|
||||
use galaxyui::elements::{CrossAxisAlignment, Fill, Flex, ParentElement, Shrinkable};
|
||||
use galaxyui::presenter::ChildView;
|
||||
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
|
||||
use galaxyui::{Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle};
|
||||
|
||||
use crate::{
|
||||
appearance::Appearance,
|
||||
editor::{EditorView, Event, SingleLineEditorOptions, TextOptions},
|
||||
report_if_error, send_telemetry_from_ctx,
|
||||
server::telemetry::TelemetryEvent,
|
||||
terminal::{
|
||||
available_shells::{AvailableShell, AvailableShells},
|
||||
local_tty::shell::is_valid_path_or_command_for_supported_shell,
|
||||
session_settings::{SessionSettings, SessionSettingsChangedEvent},
|
||||
},
|
||||
view_components::{dropdown::TOP_MENU_BAR_HEIGHT, Dropdown, DropdownItem},
|
||||
};
|
||||
use crate::appearance::Appearance;
|
||||
use crate::editor::{EditorView, Event, SingleLineEditorOptions, TextOptions};
|
||||
use crate::server::telemetry::TelemetryEvent;
|
||||
use crate::terminal::available_shells::{AvailableShell, AvailableShells};
|
||||
use crate::terminal::local_tty::shell::is_valid_path_or_command_for_supported_shell;
|
||||
use crate::terminal::session_settings::{SessionSettings, SessionSettingsChangedEvent};
|
||||
use crate::view_components::dropdown::TOP_MENU_BAR_HEIGHT;
|
||||
use crate::view_components::{Dropdown, DropdownItem};
|
||||
use crate::{report_if_error, send_telemetry_from_ctx};
|
||||
|
||||
/// A view for configuring the initial shell for new sessions. This can be the
|
||||
/// user's login shell, the default installed version of zsh, bash, or fish,
|
||||
@@ -35,7 +30,7 @@ pub struct StartupShellView {
|
||||
is_custom_path_valid: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum NewSessionShellAction {
|
||||
/// Changes the user's startup shell to the given option. This also hides
|
||||
/// the custom shell path editor if a non-custom shell was chosen.
|
||||
|
||||
@@ -1,28 +1,24 @@
|
||||
use std::{cell::RefCell, collections::HashMap, time::Duration};
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::time::Duration;
|
||||
|
||||
use settings::{Setting, ToggleableSetting};
|
||||
use galaxyui::elements::{
|
||||
Container, CrossAxisAlignment, Flex, MainAxisAlignment, MouseStateHandle, ParentElement, Text,
|
||||
};
|
||||
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
|
||||
use galaxyui::ui_components::switch::SwitchStateHandle;
|
||||
use galaxyui::{
|
||||
elements::{
|
||||
Container, CrossAxisAlignment, Flex, MainAxisAlignment, MouseStateHandle, ParentElement,
|
||||
Text,
|
||||
},
|
||||
ui_components::{
|
||||
components::{Coords, UiComponent, UiComponentStyles},
|
||||
switch::SwitchStateHandle,
|
||||
},
|
||||
AppContext, Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle,
|
||||
};
|
||||
use settings::{Setting, ToggleableSetting};
|
||||
|
||||
use crate::{
|
||||
appearance::Appearance,
|
||||
editor::{self, EditorView, SingleLineEditorOptions, TextOptions},
|
||||
report_if_error,
|
||||
settings_view::{
|
||||
features_page::render_group,
|
||||
settings_page::{render_body_item, LocalOnlyIconState, ToggleState},
|
||||
},
|
||||
undo_close::{settings::UndoCloseEnabled, UndoCloseSettings},
|
||||
};
|
||||
use crate::appearance::Appearance;
|
||||
use crate::editor::{self, EditorView, SingleLineEditorOptions, TextOptions};
|
||||
use crate::report_if_error;
|
||||
use crate::settings_view::features_page::render_group;
|
||||
use crate::settings_view::settings_page::{render_body_item, LocalOnlyIconState, ToggleState};
|
||||
use crate::undo_close::settings::UndoCloseEnabled;
|
||||
use crate::undo_close::UndoCloseSettings;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Action {
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
use galaxyui::{
|
||||
elements::{Container, CrossAxisAlignment, Flex, ParentElement, Shrinkable},
|
||||
presenter::ChildView,
|
||||
ui_components::components::{Coords, UiComponent, UiComponentStyles},
|
||||
Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use galaxyui::elements::{Container, CrossAxisAlignment, Flex, ParentElement, Shrinkable};
|
||||
use galaxyui::presenter::ChildView;
|
||||
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
|
||||
use galaxyui::{Element, Entity, SingletonEntity, TypedActionView, View, ViewContext, ViewHandle};
|
||||
|
||||
use crate::{
|
||||
appearance::Appearance,
|
||||
editor::{EditorView, Event as EditorEvent, SingleLineEditorOptions, TextOptions},
|
||||
report_if_error, send_telemetry_from_ctx,
|
||||
server::telemetry::TelemetryEvent,
|
||||
settings_view::features_page::render_group,
|
||||
terminal::session_settings::*,
|
||||
view_components::{dropdown::TOP_MENU_BAR_HEIGHT, Dropdown, DropdownItem},
|
||||
};
|
||||
use crate::appearance::Appearance;
|
||||
use crate::editor::{EditorView, Event as EditorEvent, SingleLineEditorOptions, TextOptions};
|
||||
use crate::server::telemetry::TelemetryEvent;
|
||||
use crate::settings_view::features_page::render_group;
|
||||
use crate::terminal::session_settings::*;
|
||||
use crate::view_components::dropdown::TOP_MENU_BAR_HEIGHT;
|
||||
use crate::view_components::{Dropdown, DropdownItem};
|
||||
use crate::{report_if_error, send_telemetry_from_ctx};
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
#[allow(clippy::enum_variant_names)]
|
||||
pub enum WorkingDirectoryAction {
|
||||
/// Sets the mode that should be used for all new sessions, independent of
|
||||
@@ -387,12 +384,11 @@ fn create_editor(
|
||||
editor.update(ctx, |editor, ctx| {
|
||||
editor.set_buffer_text(&initial_value, ctx);
|
||||
});
|
||||
let editor_handle = editor.clone();
|
||||
ctx.subscribe_to_view(&editor, move |me, _, event, ctx| match event {
|
||||
ctx.subscribe_to_view(&editor, move |me, editor, event, ctx| match event {
|
||||
// If the user presses enter or focus moves out of the editor view,
|
||||
// update our configuration to match the current value.
|
||||
EditorEvent::Blurred | EditorEvent::Enter => {
|
||||
let editor_contents = editor_handle.as_ref(ctx).buffer_text(ctx);
|
||||
let editor_contents = editor.as_ref(ctx).buffer_text(ctx);
|
||||
me.handle_action(
|
||||
&WorkingDirectoryAction::SetCustomWorkingDirectoryValue(source, editor_contents),
|
||||
ctx,
|
||||
|
||||
Reference in New Issue
Block a user