Skip to content

Commit

Permalink
feat: add indentation on wrapped lines (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauzi9331 authored Sep 13, 2023
1 parent e57f471 commit 367accf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 16 deletions.
45 changes: 31 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"@fortawesome/free-solid-svg-icons": "^6.4.2",
"@replit/codemirror-indentation-markers": "6.4.3",
"ajv": "^8.12.0",
"codemirror-wrapped-line-indent": "^0.0.2",
"diff-sequences": "^29.6.3",
"immutable-json-patch": "^5.1.3",
"jmespath": "^0.16.0",
Expand Down
6 changes: 4 additions & 2 deletions src/lib/components/modes/textmode/TextMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
import { faJSONEditorFormat } from '$lib/img/customFontawesomeIcons.js'
import { indentationMarkers } from '@replit/codemirror-indentation-markers'
import { isTextSelection } from '$lib/logic/selection.js'
import { wrappedLineIndent } from 'codemirror-wrapped-line-indent'
export let readOnly: boolean
export let mainMenuBar: boolean
Expand Down Expand Up @@ -594,7 +595,8 @@
tabSizeCompartment.of(EditorState.tabSize.of(tabSize)),
indentUnitCompartment.of(createIndentUnit(indentation)),
themeCompartment.of(EditorView.theme({}, { dark: hasDarkTheme() })),
EditorView.lineWrapping
EditorView.lineWrapping,
wrappedLineIndent
]
})
Expand Down Expand Up @@ -748,7 +750,7 @@
}
const codeMirrorText = getCodeMirrorValue()
const isChanged = codeMirrorText !== text
debug('onChangeCodeMirrorValue', { isChanged })
if (!isChanged) {
Expand Down

0 comments on commit 367accf

Please sign in to comment.