mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 09:36:27 +00:00
Ignore CTRL+S in editor
Some programmers have the habbit of always pressing CTRL+S which opens the browsers save as dialog and interrupts workflow. We already automatically save the current file, so we can just ignore they keypress.
This commit is contained in:
committed by
David Lechner
parent
2854ab422b
commit
df34cd4ae5
@@ -33,6 +33,18 @@ class Editor extends React.Component {
|
||||
store.dispatch(setEditSession(e?.session));
|
||||
}}
|
||||
onChange={(v): void => localStorage.setItem('program', v)}
|
||||
commands={[
|
||||
{
|
||||
name: 'save',
|
||||
bindKey: { win: 'Ctrl-S', mac: 'Cmd-S' },
|
||||
exec: (): void => {
|
||||
// We already automatically save the file
|
||||
// to local storage after every change, so
|
||||
// CTRL+S is ignored
|
||||
console.debug('CTRL+S ignored');
|
||||
},
|
||||
},
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
</ReactReduxContext.Consumer>
|
||||
|
||||
Reference in New Issue
Block a user