如何使用 CodeMirror 突出显示很长的一行?
How to highlight a very long line using CodeMirror?
我正在使用 Codemirror 替换我的文本区域。如果我将 CodeMirror 的值设置为很长的一行(超过 50,000 个单词),Codemirror 不会突出显示所有单词。突出显示在某处停止,似乎 Codemirror 只能处理每行的最大字数。我是否需要设置一些选项来解决这个问题?
谢谢。
看起来 10 000 是默认值:
maxHighlightLength: number
When highlighting long lines, in order to stay responsive, the editor
will give up and simply style the rest of the line as plain text when
it reaches a certain position. The default is 10 000. You can set this
to Infinity to turn off this behavior.
我正在使用 Codemirror 替换我的文本区域。如果我将 CodeMirror 的值设置为很长的一行(超过 50,000 个单词),Codemirror 不会突出显示所有单词。突出显示在某处停止,似乎 Codemirror 只能处理每行的最大字数。我是否需要设置一些选项来解决这个问题?
谢谢。
看起来 10 000 是默认值:
maxHighlightLength: number
When highlighting long lines, in order to stay responsive, the editor will give up and simply style the rest of the line as plain text when it reaches a certain position. The default is 10 000. You can set this to Infinity to turn off this behavior.