Skip to content

Commit f8e9f73

Browse files
committed
#2175 hotkeys: alt-O to open selected component in editor
1 parent 65022f7 commit f8e9f73

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/app-frontend/src/features/components/SelectedComponentPane.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import StateInspector from '@front/features/inspector/StateInspector.vue'
33
import EmptyPane from '@front/features/layout/EmptyPane.vue'
44
55
import { computed, defineComponent, ref, watch } from 'vue'
6-
import { SharedData, copyToClipboard, getComponentDisplayName } from '@vue-devtools/shared-utils'
6+
import { SharedData, copyToClipboard, getComponentDisplayName, openInEditor } from '@vue-devtools/shared-utils'
77
import { onKeyDown } from '@front/util/keyboard'
88
import RenderCode from './RenderCode.vue'
99
import { useSelectedComponent } from './composable'
@@ -38,6 +38,14 @@ export default defineComponent({
3838
stateFilterInput.value.focus()
3939
return false
4040
}
41+
42+
if ((['o', 'o', 'щ']).includes(event.key) && event.altKey) {
43+
const file = selectedComponent.data.value?.file
44+
if (file) {
45+
openInEditor(file)
46+
}
47+
return false
48+
}
4149
}, true)
4250
4351
const sameApp = computed(() => selectedComponent.data.value?.id.split(':')[0] === selectedComponentId.value?.split(':')[0])

packages/app-frontend/src/locales/en.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default {
7070
},
7171
ComponentInspector: {
7272
openInEditor: {
73-
tooltip: 'Open <mono><<insert_drive_file>>{{file}}</mono> in editor',
73+
tooltip: '[[{{keys.alt}}]] + [[O]] Open <mono><<insert_drive_file>>{{file}}</mono> in editor',
7474
},
7575
},
7676
EventsHistory: {

0 commit comments

Comments
 (0)