mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 16:32:31 +01:00
improvements (emacs): more emacs key bindings
This commit is contained in:
parent
cd3d19b185
commit
6fb02b1cd3
2 changed files with 11 additions and 1 deletions
|
|
@ -21,6 +21,7 @@ import 'codemirror/addon/fold/foldgutter.css';
|
|||
|
||||
import './editor.scss';
|
||||
import { debounce, screenHeightWithMenubar } from '../../helpers/';
|
||||
import config from '../../../config_client';
|
||||
|
||||
export class Editor extends React.Component {
|
||||
constructor(props){
|
||||
|
|
@ -51,7 +52,7 @@ export class Editor extends React.Component {
|
|||
value: this.props.content,
|
||||
lineNumbers: document.body.offsetWidth > size_small ? true : false,
|
||||
mode: mode,
|
||||
keyMap: "emacs",
|
||||
keyMap: config.god_editor_mode ? "emacs" : "default",
|
||||
lineWrapping: true,
|
||||
foldGutter: {
|
||||
minFoldSize: 1
|
||||
|
|
@ -70,6 +71,14 @@ export class Editor extends React.Component {
|
|||
}
|
||||
});
|
||||
|
||||
if(config.god_editor_mode === true){
|
||||
editor.addKeyMap({
|
||||
"Ctrl-X Ctrl-C": function(cm){
|
||||
history.back();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
CodeMirror.commands.save = () => {
|
||||
this.props.onSave && this.props.onSave();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
module.exports = {
|
||||
god_editor_mode: true,
|
||||
fork_button: false,
|
||||
search: {
|
||||
enable: true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue