mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 11:26:15 +01:00
fix(code/find): crashes at dialog shown
This commit is contained in:
@@ -104,6 +104,17 @@ export default class CodeMirror extends EditorView {
|
||||
return this.state.doc.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently selected text.
|
||||
*
|
||||
* If there are multiple selections, all of them will be concatenated.
|
||||
*/
|
||||
getSelectedText() {
|
||||
return this.state.selection.ranges
|
||||
.map((range) => this.state.sliceDoc(range.from, range.to))
|
||||
.join("");
|
||||
}
|
||||
|
||||
setText(content: string) {
|
||||
this.dispatch({
|
||||
changes: {
|
||||
|
||||
Reference in New Issue
Block a user