Skip to content

Commit

Permalink
fix Home/End key behavior (apply to visible line)
Browse files Browse the repository at this point in the history
  • Loading branch information
korelstar committed Jun 11, 2020
1 parent 797eada commit afa83ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/EditorEasyMDE.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit afa83ea

Please sign in to comment.