vue-codemirror icon indicating copy to clipboard operation
vue-codemirror copied to clipboard

input long text not wrap

Open hackerslizc opened this issue 1 year ago • 1 comments

Describe the bug

` import { Codemirror } from 'vue-codemirror' <codemirror v-model="code" placeholder="..." :style="{ height: height ,width:width}" :options="cmOption" :autofocus="true" :indent-with-tab="true" :tab-size="tabSize" :extensions="extensions" @ready="handleReady" @change="changeText('change', $event)" /> const cmOption = { lineNumbers: true, lineWrapping: true }

long text not wrap `

Reproduction

` import { Codemirror } from 'vue-codemirror' <codemirror v-model="code" placeholder="..." :style="{ height: height ,width:width}" :options="cmOption" :autofocus="true" :indent-with-tab="true" :tab-size="tabSize" :extensions="extensions" @ready="handleReady" @change="changeText('change', $event)" /> const cmOption = { lineNumbers: true, lineWrapping: true }

long text not wrap `

System Info

vue-codemirror version 6.1.1

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.

hackerslizc avatar Nov 01 '23 09:11 hackerslizc

You can include EditorView.lineWrapping in the extensions prop like this:

<script setup lang="ts">
import { Codemirror } from 'vue-codemirror' 
import { EditorView } from '@codemirror/view' 
</script>

<template>
  <Codemirror :extensions="[EditorView.lineWrapping]" />
</template>

ngseke avatar Dec 27 '23 15:12 ngseke