From 065e3a0272738312c316d70511ba3093d8fcb1c8 Mon Sep 17 00:00:00 2001
From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com>
Date: Wed, 4 Jun 2025 12:36:07 +0800
Subject: [PATCH 1/8] update
---
.../src/components/CodeMirrorMobileEditor.vue | 124 ++++++++++++++++++
.../src/components/FileEditorOverlay.vue | 22 +++-
2 files changed, 141 insertions(+), 5 deletions(-)
create mode 100644 packages/frontend/src/components/CodeMirrorMobileEditor.vue
diff --git a/packages/frontend/src/components/CodeMirrorMobileEditor.vue b/packages/frontend/src/components/CodeMirrorMobileEditor.vue
new file mode 100644
index 0000000..58c3956
--- /dev/null
+++ b/packages/frontend/src/components/CodeMirrorMobileEditor.vue
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
diff --git a/packages/frontend/src/components/FileEditorOverlay.vue b/packages/frontend/src/components/FileEditorOverlay.vue
index 78665c5..ebaf360 100644
--- a/packages/frontend/src/components/FileEditorOverlay.vue
+++ b/packages/frontend/src/components/FileEditorOverlay.vue
@@ -3,6 +3,7 @@ import { computed, ref, onMounted, onBeforeUnmount, watch, nextTick } from 'vue'
import { useI18n } from 'vue-i18n';
import { storeToRefs } from 'pinia';
import MonacoEditor from './MonacoEditor.vue';
+import CodeMirrorMobileEditor from './CodeMirrorMobileEditor.vue'; // +++ Import new mobile editor
import FileEditorTabs from './FileEditorTabs.vue';
import { useFileEditorStore, type FileTab } from '../stores/fileEditor.store';
import { useSettingsStore } from '../stores/settings.store';
@@ -575,9 +576,11 @@ onBeforeUnmount(() => {
{{ t('fileManager.loadingFile') }}
{{ currentTabLoadingError }}
+
+
{
:font-size="currentEditorFontSize"
@request-save="handleSaveRequest"
@update:fontSize="handleEditorFontSizeUpdate"
- :initialScrollTop="activeTab?.scrollTop ?? 0"
- :initialScrollLeft="activeTab?.scrollLeft ?? 0"
- @update:scrollPosition="handleEditorScroll"
+ :initialScrollTop="activeTab?.scrollTop ?? 0"
+ :initialScrollLeft="activeTab?.scrollLeft ?? 0"
+ @update:scrollPosition="handleEditorScroll"
+ />
+
+
{{ t('fileManager.selectFileToEdit') }}
From d31c468e37c6bb4de7194815344c5e5a3c0c80c1 Mon Sep 17 00:00:00 2001
From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com>
Date: Wed, 4 Jun 2025 12:40:54 +0800
Subject: [PATCH 2/8] Update CodeMirrorMobileEditor.vue
---
.../src/components/CodeMirrorMobileEditor.vue | 65 ++++++++++++++++++-
1 file changed, 64 insertions(+), 1 deletion(-)
diff --git a/packages/frontend/src/components/CodeMirrorMobileEditor.vue b/packages/frontend/src/components/CodeMirrorMobileEditor.vue
index 58c3956..d980d97 100644
--- a/packages/frontend/src/components/CodeMirrorMobileEditor.vue
+++ b/packages/frontend/src/components/CodeMirrorMobileEditor.vue
@@ -1,5 +1,5 @@
-
+
diff --git a/packages/frontend/src/components/FileEditorOverlay.vue b/packages/frontend/src/components/FileEditorOverlay.vue
index ebaf360..155fd02 100644
--- a/packages/frontend/src/components/FileEditorOverlay.vue
+++ b/packages/frontend/src/components/FileEditorOverlay.vue
@@ -94,6 +94,7 @@ const startHeightPx = ref(0);
const minWidth = 400; // 最小宽度
const minHeight = 300; // 最小高度
const encodingSelectRef = ref(null); // +++ Ref for the select element +++
+const codeMirrorMobileEditorRef = ref | null>(null); // +++ Ref for CodeMirrorMobileEditor +++
// --- 计算属性,用于模板绑定 ---
const popupStyle = computed(() => {
@@ -422,6 +423,13 @@ const handleEditorScroll = ({ scrollTop, scrollLeft }: { scrollTop: number; scro
const handleEditorFontSizeUpdate = (newSize: number) => {
appearanceStore.setEditorFontSize(newSize);
};
+
+// +++ 打开搜索面板 +++
+const handleOpenSearch = () => {
+ if (codeMirrorMobileEditorRef.value) {
+ codeMirrorMobileEditorRef.value.openSearch();
+ }
+};
// 关闭弹窗 (保持不变)
const handleCloseContainer = () => {
@@ -561,6 +569,17 @@ onBeforeUnmount(() => {
+
+
@@ -601,6 +620,7 @@ onBeforeUnmount(() => {
:language="currentTabLanguage"
class="editor-instance"
@request-save="handleSaveRequest"
+ ref="codeMirrorMobileEditorRef"
/>