Skip to content

Commit

Permalink
fix(ui): Socket Panel > payload edit box does not allow scrolling and…
Browse files Browse the repository at this point in the history
… does not line wrap anymore
  • Loading branch information
flawiddsouza committed Mar 6, 2024
1 parent f9fe76a commit f45899a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/ui/src/components/CodeMirrorSingleLine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { envVarDecoration } from '@/utils/codemirror-extensions'
function getExtensions(vueInstance) {
const singleLineEnforcers = []
const multiLineEnforcers = []
if(!vueInstance.allowMultipleLines) {
// From: https://discuss.codemirror.net/t/codemirror-6-single-line-and-or-avoid-carriage-return/2979/2
Expand All @@ -27,8 +28,12 @@ function getExtensions(vueInstance) {
view.update([update])
}
}
})
}),
].forEach(enforcer => singleLineEnforcers.push(enforcer))
} else {
[
EditorView.lineWrapping,
].forEach(enforcer => multiLineEnforcers.push(enforcer))
}
const extensions = [
Expand All @@ -40,6 +45,7 @@ function getExtensions(vueInstance) {
}
}),
...singleLineEnforcers,
...multiLineEnforcers,
keymap.of([
...historyKeymap
]),
Expand Down Expand Up @@ -142,7 +148,7 @@ export default {
font-family: inherit !important;
margin-left: v-bind('inputTextCompatible ? "2px" : "0.2rem"');
margin-right: v-bind('inputTextCompatible ? "2px" : "0.5rem"');
overflow: hidden;
overflow: v-bind('allowMultipleLines ? "visible" : "hidden"');
line-height: v-bind('inputTextCompatible ? "1.3" : "1.4"');
}
Expand Down

0 comments on commit f45899a

Please sign in to comment.