Selection Marking Demo选区标记演示文档 Select something from here. You'll see that the selection's foreground color changes to white! Since, by default, CodeMirror only puts an independent "marker" layer behind the text, you'll need something like this to change its colour. Also notice that turning this addon on (with the default style) allows you to safely give text a background color without screwing up the visibility of the selection. Simple addon to easily mark (and style) selected text. 简单的附件可以轻松标记(并样式化)选中的文本。Docs.