mirror of
https://github.com/heyman/heynote.git
synced 2025-06-27 04:51:50 +02:00
Prevent editor from loosing focus when line number gutter is clicked
This commit is contained in:
parent
0e8a5dfccc
commit
bc863f20fa
@ -265,7 +265,13 @@ export const blockLineNumbers = lineNumbers({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
},
|
||||||
|
domEventHandlers: {
|
||||||
|
click(view, line, event) {
|
||||||
|
// editor should not loose focus when clicking on the line numbers
|
||||||
|
view.docView.dom.focus()
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ export class HeynoteEditor {
|
|||||||
heynoteCopyCut(this),
|
heynoteCopyCut(this),
|
||||||
|
|
||||||
//minimalSetup,
|
//minimalSetup,
|
||||||
this.lineNumberCompartment.of(showLineNumberGutter ? [lineNumbers(), blockLineNumbers] : []),
|
this.lineNumberCompartment.of(showLineNumberGutter ? blockLineNumbers : []),
|
||||||
customSetup,
|
customSetup,
|
||||||
this.foldGutterCompartment.of(showFoldGutter ? [foldGutter()] : []),
|
this.foldGutterCompartment.of(showFoldGutter ? [foldGutter()] : []),
|
||||||
this.closeBracketsCompartment.of(bracketClosing ? [getCloseBracketsExtensions()] : []),
|
this.closeBracketsCompartment.of(bracketClosing ? [getCloseBracketsExtensions()] : []),
|
||||||
@ -369,7 +369,7 @@ export class HeynoteEditor {
|
|||||||
|
|
||||||
setLineNumberGutter(show) {
|
setLineNumberGutter(show) {
|
||||||
this.view.dispatch({
|
this.view.dispatch({
|
||||||
effects: this.lineNumberCompartment.reconfigure(show ? [lineNumbers(), blockLineNumbers] : []),
|
effects: this.lineNumberCompartment.reconfigure(show ? blockLineNumbers : []),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user