mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Merge branch 'master' into feat/display-url-title
# Conflicts: # browser/components/CodeEditor.js # browser/finder/NoteDetail.js
This commit is contained in:
@@ -51,9 +51,10 @@ export default class CodeEditor extends React.Component {
|
||||
|
||||
componentDidMount () {
|
||||
this.value = this.props.value
|
||||
|
||||
this.editor = CodeMirror(this.refs.root, {
|
||||
value: this.props.value,
|
||||
lineNumbers: true,
|
||||
lineNumbers: this.props.displayLineNumbers,
|
||||
lineWrapping: true,
|
||||
theme: this.props.theme,
|
||||
indentUnit: this.props.indentSize,
|
||||
@@ -71,7 +72,7 @@ export default class CodeEditor extends React.Component {
|
||||
if (cm.somethingSelected()) cm.indentSelection('add')
|
||||
else {
|
||||
const tabs = cm.getOption('indentWithTabs')
|
||||
if (line.trimLeft().match(/^(-|\*|\+) (\[( |x)\] )?$/)) {
|
||||
if (line.trimLeft().match(/^(-|\*|\+) (\[( |x)] )?$/)) {
|
||||
cm.execCommand('goLineStart')
|
||||
if (tabs) {
|
||||
cm.execCommand('insertTab')
|
||||
@@ -156,6 +157,10 @@ export default class CodeEditor extends React.Component {
|
||||
this.editor.setOption('indentWithTabs', this.props.indentType !== 'space')
|
||||
}
|
||||
|
||||
if (prevProps.displayLineNumbers !== this.props.displayLineNumbers) {
|
||||
this.editor.setOption('lineNumbers', this.props.displayLineNumbers)
|
||||
}
|
||||
|
||||
if (prevProps.scrollPastEnd !== this.props.scrollPastEnd) {
|
||||
this.editor.setOption('scrollPastEnd', this.props.scrollPastEnd)
|
||||
}
|
||||
|
||||
@@ -242,6 +242,7 @@ class MarkdownEditor extends React.Component {
|
||||
fontSize={editorFontSize}
|
||||
indentType={config.editor.indentType}
|
||||
indentSize={editorIndentSize}
|
||||
displayLineNumbers={config.editor.displayLineNumbers}
|
||||
scrollPastEnd={config.editor.scrollPastEnd}
|
||||
storageKey={storageKey}
|
||||
fetchUrlTitle={config.editor.fetchUrlTitle}
|
||||
|
||||
@@ -62,6 +62,7 @@ class MarkdownSplitEditor extends React.Component {
|
||||
keyMap={config.editor.keyMap}
|
||||
fontFamily={config.editor.fontFamily}
|
||||
fontSize={editorFontSize}
|
||||
displayLineNumbers={config.editor.displayLineNumbers}
|
||||
indentType={config.editor.indentType}
|
||||
indentSize={editorIndentSize}
|
||||
scrollPastEnd={config.editor.scrollPastEnd}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.percentageBar
|
||||
position absolute
|
||||
top 50px
|
||||
top 72px
|
||||
right 0px
|
||||
left 0px
|
||||
background-color #DADFE1
|
||||
|
||||
Reference in New Issue
Block a user