mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2026-10-19 16:14:39 +00:00
improvements (emacs): more emacs key bindings
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user