perf: memo GridCard, fuse save fns, fix slash tab active color
This commit is contained in:
@@ -352,7 +352,7 @@ export const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorPro
|
||||
if (!range) {
|
||||
const { from } = ed.state.selection
|
||||
const start = Math.max(0, from - 80)
|
||||
const textBefore = ed.state.doc.textBetween(start, from, '\n', '\0')
|
||||
const textBefore = ed.state.doc.textBetween(start, from, '\n', '')
|
||||
const match = textBefore.match(/\[\[([^\]]*)$/)
|
||||
if (match) {
|
||||
range = { from: from - match[0].length, to: from }
|
||||
@@ -531,7 +531,7 @@ export const RichTextEditor = forwardRef<RichTextEditorHandle, RichTextEditorPro
|
||||
const { from, empty } = e.state.selection
|
||||
if (!empty) return
|
||||
const start = Math.max(0, from - 80)
|
||||
const textBefore = e.state.doc.textBetween(start, from, '\n', '\0')
|
||||
const textBefore = e.state.doc.textBetween(start, from, '\n', '')
|
||||
const match = textBefore.match(/\[\[([^\]]*)$/)
|
||||
if (match) {
|
||||
noteLinkRangeRef.current = { from: from - match[0].length, to: from }
|
||||
|
||||
Reference in New Issue
Block a user