fix Home/End key behavior (apply to visible line)

This commit is contained in:
korelstar 2020-06-11 15:32:09 +02:00
parent 797eada658
commit afa83ea717
1 changed files with 8 additions and 0 deletions

View File

@ -57,10 +57,18 @@ export default {
this.mde = new EasyMDE(config)
// keys Home/End should apply to the visual line
this.mde.codemirror.addKeyMap({
'Home': 'goLineLeft',
'End': 'goLineRight',
})
// pass event for changes
this.mde.codemirror.on('change', () => {
this.$emit('input', this.mde.value())
})
// listen for click/touch events in order to toggle checkboxes
document.querySelectorAll('.CodeMirror-code').forEach((codeElement) => {
codeElement.addEventListener('mousedown', this.onClickCodeElement)
codeElement.addEventListener('touchstart', this.onClickCodeElement)