Added Line Wrapping to Codeview of CodeMirror (#9563)

* Added Line Wrapping to Codeview of CodeMirror

In the formated code fields line breaks are not done, which requires
scrolling. This might be configurable in the future.

* Make line-wrapping an opt-in options

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Dr. Matthias Jung
2021-12-01 23:27:09 +01:00
committed by GitHub
parent 3bdf97afaa
commit c16592806d
3 changed files with 19 additions and 1 deletions

View File

@@ -48,6 +48,18 @@ export default defineInterface({
width: 'half',
interface: 'boolean',
},
schema: {
default_value: true,
},
},
{
field: 'lineWrapping',
name: '$t:interfaces.input-code.line_wrapping',
type: 'boolean',
meta: {
width: 'half',
interface: 'boolean',
},
schema: {
default_value: false,
},
@@ -75,7 +87,7 @@ export default defineInterface({
name: '$t:language',
type: 'string',
meta: {
width: 'half',
width: 'full',
interface: 'select-dropdown',
options: { choices },
},

View File

@@ -51,6 +51,10 @@ export default defineComponent({
type: Boolean,
default: true,
},
lineWrapping: {
type: Boolean,
default: false,
},
placeholder: {
type: String,
default: null,
@@ -237,6 +241,7 @@ export default defineComponent({
defaultOptions,
{
lineNumbers: props.lineNumber,
lineWrapping: props.lineWrapping,
readOnly: props.disabled ? 'nocursor' : false,
mode: props.language,
placeholder: props.placeholder,