dsh-gufa-code 1.3.192 → 1.3.193
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +19 -1
- package/package.json +1 -1
- package/src/client/20-editor.js +18 -0
package/client.js
CHANGED
|
@@ -16,7 +16,7 @@ const GUFA_NS = 'gufa-code'
|
|
|
16
16
|
const G = {}
|
|
17
17
|
G.NS = GUFA_NS
|
|
18
18
|
/** 客户端构建标记(排查页面是否加载了新代码时看标题栏) */
|
|
19
|
-
G.BUILD = '1.3.
|
|
19
|
+
G.BUILD = '1.3.193'
|
|
20
20
|
G.PANEL_ID = 'gufa-code'
|
|
21
21
|
/** 从哪个工作区点进来的(工作区菜单/节点按钮写入,App 启动时消费)。 */
|
|
22
22
|
G.pendingEntryWorkspace = null
|
|
@@ -3368,6 +3368,22 @@ const GUFA_LINT_ENABLED = true
|
|
|
3368
3368
|
|
|
3369
3369
|
/* ── 组件 ───────────────────────────────────────────────────────────── */
|
|
3370
3370
|
|
|
3371
|
+
/** 显式绑定 Cmd/Ctrl+Shift+L = 选中当前词在文件里的所有匹配项(VS Code/Cursor 习惯)。 */
|
|
3372
|
+
function gufaBindSelectAllOccurrences(monacoInstance, editor) {
|
|
3373
|
+
try {
|
|
3374
|
+
editor.addAction({
|
|
3375
|
+
id: 'gufa.selectAllOccurrences',
|
|
3376
|
+
label: '选中所有匹配项',
|
|
3377
|
+
keybindings: [monacoInstance.KeyMod.CtrlCmd | monacoInstance.KeyMod.Shift | monacoInstance.KeyCode.KeyL],
|
|
3378
|
+
run: (target) => {
|
|
3379
|
+
try { target.trigger('gufa-select-occurrences', 'editor.action.selectHighlights', null) } catch { /* ignore */ }
|
|
3380
|
+
},
|
|
3381
|
+
})
|
|
3382
|
+
} catch {
|
|
3383
|
+
/* ignore */
|
|
3384
|
+
}
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3371
3387
|
function GufaEditorPaneComponent(props) {
|
|
3372
3388
|
const tabs = useMemo(() => (Array.isArray(props.tabs) ? props.tabs : []), [props.tabs])
|
|
3373
3389
|
const activePath = typeof props.activePath === 'string' ? props.activePath : null
|
|
@@ -3616,6 +3632,7 @@ const GUFA_LINT_ENABLED = true
|
|
|
3616
3632
|
const instance = monaco.editor.create(host, gufaEditorOptions(propsRef.current.theme))
|
|
3617
3633
|
editor = instance
|
|
3618
3634
|
editorRef.current = instance
|
|
3635
|
+
gufaBindSelectAllOccurrences(monaco, instance)
|
|
3619
3636
|
try {
|
|
3620
3637
|
try {
|
|
3621
3638
|
G.__gufaEditorController = {
|
|
@@ -4544,6 +4561,7 @@ const GUFA_LINT_ENABLED = true
|
|
|
4544
4561
|
scrollbar: { verticalScrollbarSize: 10, horizontalScrollbarSize: 10 },
|
|
4545
4562
|
})
|
|
4546
4563
|
instance.setModel({ original: originalModel, modified: modifiedModel })
|
|
4564
|
+
try { gufaBindSelectAllOccurrences(monaco, instance.getModifiedEditor()) } catch { /* ignore */ }
|
|
4547
4565
|
} catch (error) {
|
|
4548
4566
|
try {
|
|
4549
4567
|
originalModel.dispose()
|
package/package.json
CHANGED
package/src/client/20-editor.js
CHANGED
|
@@ -714,6 +714,22 @@ const GUFA_LINT_ENABLED = true
|
|
|
714
714
|
|
|
715
715
|
/* ── 组件 ───────────────────────────────────────────────────────────── */
|
|
716
716
|
|
|
717
|
+
/** 显式绑定 Cmd/Ctrl+Shift+L = 选中当前词在文件里的所有匹配项(VS Code/Cursor 习惯)。 */
|
|
718
|
+
function gufaBindSelectAllOccurrences(monacoInstance, editor) {
|
|
719
|
+
try {
|
|
720
|
+
editor.addAction({
|
|
721
|
+
id: 'gufa.selectAllOccurrences',
|
|
722
|
+
label: '选中所有匹配项',
|
|
723
|
+
keybindings: [monacoInstance.KeyMod.CtrlCmd | monacoInstance.KeyMod.Shift | monacoInstance.KeyCode.KeyL],
|
|
724
|
+
run: (target) => {
|
|
725
|
+
try { target.trigger('gufa-select-occurrences', 'editor.action.selectHighlights', null) } catch { /* ignore */ }
|
|
726
|
+
},
|
|
727
|
+
})
|
|
728
|
+
} catch {
|
|
729
|
+
/* ignore */
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
717
733
|
function GufaEditorPaneComponent(props) {
|
|
718
734
|
const tabs = useMemo(() => (Array.isArray(props.tabs) ? props.tabs : []), [props.tabs])
|
|
719
735
|
const activePath = typeof props.activePath === 'string' ? props.activePath : null
|
|
@@ -962,6 +978,7 @@ const GUFA_LINT_ENABLED = true
|
|
|
962
978
|
const instance = monaco.editor.create(host, gufaEditorOptions(propsRef.current.theme))
|
|
963
979
|
editor = instance
|
|
964
980
|
editorRef.current = instance
|
|
981
|
+
gufaBindSelectAllOccurrences(monaco, instance)
|
|
965
982
|
try {
|
|
966
983
|
try {
|
|
967
984
|
G.__gufaEditorController = {
|
|
@@ -1890,6 +1907,7 @@ const GUFA_LINT_ENABLED = true
|
|
|
1890
1907
|
scrollbar: { verticalScrollbarSize: 10, horizontalScrollbarSize: 10 },
|
|
1891
1908
|
})
|
|
1892
1909
|
instance.setModel({ original: originalModel, modified: modifiedModel })
|
|
1910
|
+
try { gufaBindSelectAllOccurrences(monaco, instance.getModifiedEditor()) } catch { /* ignore */ }
|
|
1893
1911
|
} catch (error) {
|
|
1894
1912
|
try {
|
|
1895
1913
|
originalModel.dispose()
|