mirror of
https://github.com/heyman/heynote.git
synced 2025-06-27 13:01:51 +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 ""
|
||||
}
|
||||
},
|
||||
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),
|
||||
|
||||
//minimalSetup,
|
||||
this.lineNumberCompartment.of(showLineNumberGutter ? [lineNumbers(), blockLineNumbers] : []),
|
||||
this.lineNumberCompartment.of(showLineNumberGutter ? blockLineNumbers : []),
|
||||
customSetup,
|
||||
this.foldGutterCompartment.of(showFoldGutter ? [foldGutter()] : []),
|
||||
this.closeBracketsCompartment.of(bracketClosing ? [getCloseBracketsExtensions()] : []),
|
||||
@ -369,7 +369,7 @@ export class HeynoteEditor {
|
||||
|
||||
setLineNumberGutter(show) {
|
||||
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