Skip to content

Commit afa83ea

Browse files
committed
fix Home/End key behavior (apply to visible line)
1 parent 797eada commit afa83ea

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/components/EditorEasyMDE.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,18 @@ export default {
5757
5858
this.mde = new EasyMDE(config)
5959
60+
// keys Home/End should apply to the visual line
61+
this.mde.codemirror.addKeyMap({
62+
'Home': 'goLineLeft',
63+
'End': 'goLineRight',
64+
})
65+
66+
// pass event for changes
6067
this.mde.codemirror.on('change', () => {
6168
this.$emit('input', this.mde.value())
6269
})
6370
71+
// listen for click/touch events in order to toggle checkboxes
6472
document.querySelectorAll('.CodeMirror-code').forEach((codeElement) => {
6573
codeElement.addEventListener('mousedown', this.onClickCodeElement)
6674
codeElement.addEventListener('touchstart', this.onClickCodeElement)

0 commit comments

Comments
 (0)