Skip to content

Commit e5f5ab5

Browse files
author
Ives van Hoorne
committed
Add prettify action
1 parent 69b4e71 commit e5f5ab5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/app/src/app/containers/QuickActions/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const Entry = styled.div`
7070
align-items: center;
7171
font-size: 0.875rem;
7272
padding: 0.25rem 0.75rem;
73+
min-height: 1.5rem;
7374
cursor: pointer;
7475
7576
${({ isActive }) =>

packages/app/src/app/store/preferences/keybindings.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import preferenceActions from './actions';
22
import { preferencesSelector } from './selectors';
3+
import { singleSandboxSelector } from '../entities/sandboxes/selectors';
34
import sandboxActions from '../entities/sandboxes/actions';
45
import viewActions from '../view/actions';
56
import modalActions from '../modal/actions';
7+
import moduleActions from '../entities/sandboxes/modules/actions';
68
import {
79
devToolsOpenSelector,
810
workspaceHiddenSelector,
@@ -135,4 +137,16 @@ export const KEYBINDINGS = {
135137
dispatch(modalActions.openSearchDependencies(id));
136138
},
137139
},
140+
141+
'source.modules.prettify': {
142+
title: 'Prettify Current File',
143+
type: 'Source',
144+
bindings: [],
145+
action: ({ id }) => (dispatch: Function, getState: Function) => {
146+
const sandbox = singleSandboxSelector(getState(), { id });
147+
if (sandbox) {
148+
dispatch(moduleActions.prettifyModule(sandbox.currentModule));
149+
}
150+
},
151+
},
138152
};

0 commit comments

Comments
 (0)