Skip to content

Commit 367accf

Browse files
authoredSep 13, 2023
feat: add indentation on wrapped lines (#295)
1 parent e57f471 commit 367accf

File tree

3 files changed

+36
-16
lines changed

3 files changed

+36
-16
lines changed
 

‎package-lock.json

+31-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
"@fortawesome/free-solid-svg-icons": "^6.4.2",
8484
"@replit/codemirror-indentation-markers": "6.4.3",
8585
"ajv": "^8.12.0",
86+
"codemirror-wrapped-line-indent": "^0.0.2",
8687
"diff-sequences": "^29.6.3",
8788
"immutable-json-patch": "^5.1.3",
8889
"jmespath": "^0.16.0",

‎src/lib/components/modes/textmode/TextMode.svelte

+4-2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
import { faJSONEditorFormat } from '$lib/img/customFontawesomeIcons.js'
116116
import { indentationMarkers } from '@replit/codemirror-indentation-markers'
117117
import { isTextSelection } from '$lib/logic/selection.js'
118+
import { wrappedLineIndent } from 'codemirror-wrapped-line-indent'
118119
119120
export let readOnly: boolean
120121
export let mainMenuBar: boolean
@@ -594,7 +595,8 @@
594595
tabSizeCompartment.of(EditorState.tabSize.of(tabSize)),
595596
indentUnitCompartment.of(createIndentUnit(indentation)),
596597
themeCompartment.of(EditorView.theme({}, { dark: hasDarkTheme() })),
597-
EditorView.lineWrapping
598+
EditorView.lineWrapping,
599+
wrappedLineIndent
598600
]
599601
})
600602
@@ -748,7 +750,7 @@
748750
}
749751
750752
const codeMirrorText = getCodeMirrorValue()
751-
753+
752754
const isChanged = codeMirrorText !== text
753755
debug('onChangeCodeMirrorValue', { isChanged })
754756
if (!isChanged) {

0 commit comments

Comments
 (0)
Please sign in to comment.