mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Merge pull request #218 from asmsuechan/feature-vim-keymap
Adds vim keymap setting
This commit is contained in:
@@ -52,7 +52,7 @@ export default class CodeEditor extends React.Component {
|
||||
indentUnit: this.props.indentSize,
|
||||
tabSize: this.props.indentSize,
|
||||
indentWithTabs: this.props.indentType !== 'space',
|
||||
keyMap: 'sublime',
|
||||
keyMap: this.props.keyMap,
|
||||
inputStyle: 'textarea',
|
||||
extraKeys: {
|
||||
Tab: function (cm) {
|
||||
@@ -102,6 +102,9 @@ export default class CodeEditor extends React.Component {
|
||||
if (prevProps.fontFamily !== this.props.fontFamily) {
|
||||
needRefresh = true
|
||||
}
|
||||
if (prevProps.keyMap !== this.props.keyMap) {
|
||||
needRefresh = true
|
||||
}
|
||||
|
||||
if (prevProps.indentSize !== this.props.indentSize) {
|
||||
this.editor.setOption('indentUnit', this.props.indentSize)
|
||||
@@ -194,6 +197,7 @@ CodeEditor.propTypes = {
|
||||
CodeEditor.defaultProps = {
|
||||
readOnly: false,
|
||||
theme: 'xcode',
|
||||
keyMap: 'sublime',
|
||||
fontSize: 14,
|
||||
fontFamily: 'Monaco, Consolas',
|
||||
indentSize: 4,
|
||||
|
||||
@@ -166,6 +166,7 @@ class MarkdownEditor extends React.Component {
|
||||
mode='GitHub Flavored Markdown'
|
||||
value={value}
|
||||
theme={config.editor.theme}
|
||||
keyMap={config.editor.keyMap}
|
||||
fontFamily={config.editor.fontFamily}
|
||||
fontSize={editorFontSize}
|
||||
indentType={config.editor.indentType}
|
||||
@@ -179,6 +180,7 @@ class MarkdownEditor extends React.Component {
|
||||
}
|
||||
style={previewStyle}
|
||||
theme={config.ui.theme}
|
||||
keyMap={config.editor.keyMap}
|
||||
fontSize={config.preview.fontSize}
|
||||
fontFamily={config.preview.fontFamily}
|
||||
codeBlockTheme={config.preview.codeBlockTheme}
|
||||
|
||||
Reference in New Issue
Block a user