dsh-gufa-code 1.3.193 → 1.3.196
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 +20 -8
- package/package.json +1 -1
- package/src/client/20-editor.js +12 -7
- package/src/client/85-shortcuts.js +4 -0
- package/src/client/90-app.js +3 -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.196'
|
|
20
20
|
G.PANEL_ID = 'gufa-code'
|
|
21
21
|
/** 从哪个工作区点进来的(工作区菜单/节点按钮写入,App 启动时消费)。 */
|
|
22
22
|
G.pendingEntryWorkspace = null
|
|
@@ -3371,14 +3371,13 @@ const GUFA_LINT_ENABLED = true
|
|
|
3371
3371
|
/** 显式绑定 Cmd/Ctrl+Shift+L = 选中当前词在文件里的所有匹配项(VS Code/Cursor 习惯)。 */
|
|
3372
3372
|
function gufaBindSelectAllOccurrences(monacoInstance, editor) {
|
|
3373
3373
|
try {
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
try { target.trigger('gufa-select-occurrences', 'editor.action.selectHighlights', null) } catch { /* ignore */ }
|
|
3374
|
+
/* addCommand 是底层键位绑定,比 addAction 更可靠(addAction 可能被同名内置 action 覆盖)。 */
|
|
3375
|
+
editor.addCommand(
|
|
3376
|
+
monacoInstance.KeyMod.CtrlCmd | monacoInstance.KeyMod.Shift | monacoInstance.KeyCode.KeyL,
|
|
3377
|
+
() => {
|
|
3378
|
+
try { editor.trigger('gufa-select-occurrences', 'editor.action.selectHighlights', null) } catch { /* ignore */ }
|
|
3380
3379
|
},
|
|
3381
|
-
|
|
3380
|
+
)
|
|
3382
3381
|
} catch {
|
|
3383
3382
|
/* ignore */
|
|
3384
3383
|
}
|
|
@@ -4681,6 +4680,12 @@ const GUFA_LINT_ENABLED = true
|
|
|
4681
4680
|
}
|
|
4682
4681
|
const editor = editorRef.current
|
|
4683
4682
|
const monaco = monacoRef.current
|
|
4683
|
+
if ((editor === null || editor === undefined) && diffEditorRef.current !== null && diffEditorRef.current !== undefined) {
|
|
4684
|
+
try {
|
|
4685
|
+
diffEditorRef.current.getModifiedEditor().trigger('gufa-shortcut', commandId, null)
|
|
4686
|
+
return
|
|
4687
|
+
} catch { /* ignore */ }
|
|
4688
|
+
}
|
|
4684
4689
|
if (editor !== null && monaco !== null) {
|
|
4685
4690
|
editor.trigger('gufa-shortcut', commandId, null)
|
|
4686
4691
|
if (commandId.includes('moveLines')) {
|
|
@@ -12060,6 +12065,7 @@ G.shortcutAction = function shortcutAction(event) {
|
|
|
12060
12065
|
if (key === 'b') return 'toggleSidebar'
|
|
12061
12066
|
if (key === 'w') return 'closeTab'
|
|
12062
12067
|
if (key === 'n') return 'newWindow'
|
|
12068
|
+
if (key === 'l') return 'selectAllOccurrences'
|
|
12063
12069
|
if (isBackquote) return 'newTerminal'
|
|
12064
12070
|
if (key === '/' || key === '?') return 'shortcuts'
|
|
12065
12071
|
if (key === 'enter' || code === 'Enter' || code === 'NumpadEnter') return 'commit'
|
|
@@ -12282,6 +12288,9 @@ G.installShortcutIntegration = function installShortcutIntegration(service) {
|
|
|
12282
12288
|
'sidebar.left.toggle': 'toggleSidebar',
|
|
12283
12289
|
'edrv.save': 'save',
|
|
12284
12290
|
'edrv.closeTab': 'closeTab',
|
|
12291
|
+
/* pet-chat 插件占用了 Cmd/Ctrl+Shift+L(它用它切换宠物对话悬浮窗),
|
|
12292
|
+
IDE 编辑器里必须抢回来做「选中所有匹配项」。 */
|
|
12293
|
+
'pet-chat.float': 'selectAllOccurrences',
|
|
12285
12294
|
/* DSH 桌面端把 Ctrl+W/Cmd+W 默认绑给右侧页面关闭(page.close),
|
|
12286
12295
|
它在 main 进程就被截走,浏览器里的 keydown 收不到;IDE 里要改派成关标签页。 */
|
|
12287
12296
|
'page.close': 'closeTab',
|
|
@@ -15037,6 +15046,9 @@ G.GufaApp = function GufaApp(props) {
|
|
|
15037
15046
|
}
|
|
15038
15047
|
G.bus.emit('terminal:clear')
|
|
15039
15048
|
},
|
|
15049
|
+
selectAllOccurrences: () => {
|
|
15050
|
+
if (G.bus !== null && G.bus !== undefined && typeof G.bus.emit === 'function') G.bus.emit('editor:command', 'editor.action.selectHighlights')
|
|
15051
|
+
},
|
|
15040
15052
|
toggleTerminal: () => patchUi({ terminalOpen: ui.terminalOpen !== true }),
|
|
15041
15053
|
toggleSidebar: () => patchUi({ sidebarOpen: ui.sidebarOpen === false }),
|
|
15042
15054
|
closeTab: () => {
|
package/package.json
CHANGED
package/src/client/20-editor.js
CHANGED
|
@@ -717,14 +717,13 @@ const GUFA_LINT_ENABLED = true
|
|
|
717
717
|
/** 显式绑定 Cmd/Ctrl+Shift+L = 选中当前词在文件里的所有匹配项(VS Code/Cursor 习惯)。 */
|
|
718
718
|
function gufaBindSelectAllOccurrences(monacoInstance, editor) {
|
|
719
719
|
try {
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
try { target.trigger('gufa-select-occurrences', 'editor.action.selectHighlights', null) } catch { /* ignore */ }
|
|
720
|
+
/* addCommand 是底层键位绑定,比 addAction 更可靠(addAction 可能被同名内置 action 覆盖)。 */
|
|
721
|
+
editor.addCommand(
|
|
722
|
+
monacoInstance.KeyMod.CtrlCmd | monacoInstance.KeyMod.Shift | monacoInstance.KeyCode.KeyL,
|
|
723
|
+
() => {
|
|
724
|
+
try { editor.trigger('gufa-select-occurrences', 'editor.action.selectHighlights', null) } catch { /* ignore */ }
|
|
726
725
|
},
|
|
727
|
-
|
|
726
|
+
)
|
|
728
727
|
} catch {
|
|
729
728
|
/* ignore */
|
|
730
729
|
}
|
|
@@ -2027,6 +2026,12 @@ const GUFA_LINT_ENABLED = true
|
|
|
2027
2026
|
}
|
|
2028
2027
|
const editor = editorRef.current
|
|
2029
2028
|
const monaco = monacoRef.current
|
|
2029
|
+
if ((editor === null || editor === undefined) && diffEditorRef.current !== null && diffEditorRef.current !== undefined) {
|
|
2030
|
+
try {
|
|
2031
|
+
diffEditorRef.current.getModifiedEditor().trigger('gufa-shortcut', commandId, null)
|
|
2032
|
+
return
|
|
2033
|
+
} catch { /* ignore */ }
|
|
2034
|
+
}
|
|
2030
2035
|
if (editor !== null && monaco !== null) {
|
|
2031
2036
|
editor.trigger('gufa-shortcut', commandId, null)
|
|
2032
2037
|
if (commandId.includes('moveLines')) {
|
|
@@ -52,6 +52,7 @@ G.shortcutAction = function shortcutAction(event) {
|
|
|
52
52
|
if (key === 'b') return 'toggleSidebar'
|
|
53
53
|
if (key === 'w') return 'closeTab'
|
|
54
54
|
if (key === 'n') return 'newWindow'
|
|
55
|
+
if (key === 'l') return 'selectAllOccurrences'
|
|
55
56
|
if (isBackquote) return 'newTerminal'
|
|
56
57
|
if (key === '/' || key === '?') return 'shortcuts'
|
|
57
58
|
if (key === 'enter' || code === 'Enter' || code === 'NumpadEnter') return 'commit'
|
|
@@ -274,6 +275,9 @@ G.installShortcutIntegration = function installShortcutIntegration(service) {
|
|
|
274
275
|
'sidebar.left.toggle': 'toggleSidebar',
|
|
275
276
|
'edrv.save': 'save',
|
|
276
277
|
'edrv.closeTab': 'closeTab',
|
|
278
|
+
/* pet-chat 插件占用了 Cmd/Ctrl+Shift+L(它用它切换宠物对话悬浮窗),
|
|
279
|
+
IDE 编辑器里必须抢回来做「选中所有匹配项」。 */
|
|
280
|
+
'pet-chat.float': 'selectAllOccurrences',
|
|
277
281
|
/* DSH 桌面端把 Ctrl+W/Cmd+W 默认绑给右侧页面关闭(page.close),
|
|
278
282
|
它在 main 进程就被截走,浏览器里的 keydown 收不到;IDE 里要改派成关标签页。 */
|
|
279
283
|
'page.close': 'closeTab',
|
package/src/client/90-app.js
CHANGED
|
@@ -2414,6 +2414,9 @@ G.GufaApp = function GufaApp(props) {
|
|
|
2414
2414
|
}
|
|
2415
2415
|
G.bus.emit('terminal:clear')
|
|
2416
2416
|
},
|
|
2417
|
+
selectAllOccurrences: () => {
|
|
2418
|
+
if (G.bus !== null && G.bus !== undefined && typeof G.bus.emit === 'function') G.bus.emit('editor:command', 'editor.action.selectHighlights')
|
|
2419
|
+
},
|
|
2417
2420
|
toggleTerminal: () => patchUi({ terminalOpen: ui.terminalOpen !== true }),
|
|
2418
2421
|
toggleSidebar: () => patchUi({ sidebarOpen: ui.sidebarOpen === false }),
|
|
2419
2422
|
closeTab: () => {
|