|
|
@@ -117,44 +117,9 @@ watch(
|
|
|
}
|
|
|
)
|
|
|
|
|
|
-// Editor extensions
|
|
|
+// Editor extensions - using Codemirror default styles
|
|
|
const extensions = computed(() => {
|
|
|
- const exts: any[] = [
|
|
|
- EditorView.lineWrapping,
|
|
|
- EditorView.theme({
|
|
|
- '&': {
|
|
|
- fontSize: '13px',
|
|
|
- border: '1px solid #dcdfe6',
|
|
|
- borderRadius: '0 0 4px 4px',
|
|
|
- borderTop: 'none'
|
|
|
- },
|
|
|
- '.cm-content': {
|
|
|
- fontFamily: "'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace",
|
|
|
- padding: '8px 0'
|
|
|
- },
|
|
|
- '.cm-gutters': {
|
|
|
- backgroundColor: '#f5f7fa',
|
|
|
- color: '#909399',
|
|
|
- border: 'none',
|
|
|
- borderRight: '1px solid #e4e7ed'
|
|
|
- },
|
|
|
- '.cm-activeLineGutter': {
|
|
|
- backgroundColor: '#e8eaed'
|
|
|
- },
|
|
|
- '.cm-activeLine': {
|
|
|
- backgroundColor: '#f5f7fa'
|
|
|
- },
|
|
|
- '&.cm-focused': {
|
|
|
- outline: 'none'
|
|
|
- },
|
|
|
- '&.cm-focused .cm-selectionBackground, ::selection': {
|
|
|
- backgroundColor: '#d7d4f0 !important'
|
|
|
- },
|
|
|
- '.cm-placeholder': {
|
|
|
- color: '#909399'
|
|
|
- }
|
|
|
- })
|
|
|
- ]
|
|
|
+ const exts: any[] = [EditorView.lineWrapping]
|
|
|
|
|
|
// Add language-specific syntax highlighting
|
|
|
if (props.language === 'json') {
|
|
|
@@ -323,8 +288,4 @@ defineExpose({
|
|
|
:deep(.cm-scroller) {
|
|
|
overflow: auto;
|
|
|
}
|
|
|
-
|
|
|
-:deep(.cm-line) {
|
|
|
- padding-left: 8px;
|
|
|
-}
|
|
|
</style>
|