surmon-china / vue-codemirror

@codemirror code editor component for @vuejs

Home Page:https://github.surmon.me/vue-codemirror

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When editing content, pressing the delete key once will delete two characters

goozi opened this issue · comments

commented

Describe the bug

<Codemirror class="code" v-model="editorValue" :autofocus="true" :extensions="extensions"
                    @change="handleClick('change', $event)" @longtap="copy"
                    @click="copy"/>

import {Codemirror} from "vue-codemirror";
import {markdown} from "@codemirror/lang-markdown";
import {oneDark} from "@codemirror/theme-one-dark";

My code, as shown above, works fine, but when I edit the markdown text, two characters are deleted every time I press the delete key, and the code does not report any errors. I checked long enough not to know exactly how it happened.

Reproduction

The code does not report errors

System Info

macbook 
node 16.20.0
vue:3.2.45

"codemirror": "^6.0.1",
"vue-codemirror": "^6.1.1",
"@codemirror/lang-markdown": "^6.1.1",
"@codemirror/theme-one-dark": "^6.1.2"

Used Package Manager

npm

Validations

  • Read the the documentation in detail.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
  • The provided reproduction is a minimal reproducible example of the bug.