diff --git a/packages/app-frontend/src/features/components/SelectedComponentPane.vue b/packages/app-frontend/src/features/components/SelectedComponentPane.vue index ec40bb2e4..9d5df14d1 100644 --- a/packages/app-frontend/src/features/components/SelectedComponentPane.vue +++ b/packages/app-frontend/src/features/components/SelectedComponentPane.vue @@ -3,7 +3,7 @@ import StateInspector from '@front/features/inspector/StateInspector.vue' import EmptyPane from '@front/features/layout/EmptyPane.vue' import { computed, defineComponent, ref, watch } from 'vue' -import { SharedData, copyToClipboard, getComponentDisplayName } from '@vue-devtools/shared-utils' +import { SharedData, copyToClipboard, getComponentDisplayName, openInEditor } from '@vue-devtools/shared-utils' import { onKeyDown } from '@front/util/keyboard' import RenderCode from './RenderCode.vue' import { useSelectedComponent } from './composable' @@ -16,6 +16,8 @@ export default defineComponent({ }, setup() { + const openInEditorButton = ref() + const selectedComponent = useSelectedComponent() const displayName = computed(() => getComponentDisplayName(selectedComponent.data.value?.name ?? '', SharedData.componentNameStyle)) @@ -38,6 +40,14 @@ export default defineComponent({ stateFilterInput.value.focus() return false } + + if ((['o', 'o', 'щ']).includes(event.key) && event.altKey) { + const file = selectedComponent.data.value?.file + if (file) { + openInEditor(file) + } + return false + } }, true) const sameApp = computed(() => selectedComponent.data.value?.id.split(':')[0] === selectedComponentId.value?.split(':')[0]) @@ -63,6 +73,7 @@ export default defineComponent({ sameApp, copyName, showCopiedName, + openInEditorButton, } }, }) @@ -128,6 +139,7 @@ export default defineComponent({