mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
MD Editor: Worked to improve/fix positioning code
Still pending testing. Old logic did not work when lines would wrap, so changing things to a character/line measuring technique. Fixed some other isues too while testing shortcuts.
This commit is contained in:
@@ -72,8 +72,8 @@ export class CodemirrorInput implements MarkdownEditorInput {
|
||||
return this.cm.state.doc.lineAt(index).text;
|
||||
}
|
||||
|
||||
coordsToSelection(x: number, y: number): MarkdownEditorInputSelection {
|
||||
const cursorPos = this.cm.posAtCoords({x, y}, false);
|
||||
eventToPosition(event: MouseEvent): MarkdownEditorInputSelection {
|
||||
const cursorPos = this.cm.posAtCoords({x: event.screenX, y: event.screenY}, false);
|
||||
return {from: cursorPos, to: cursorPos};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user