fix: line wrap respects indentation
This commit is contained in:
@@ -40,6 +40,7 @@ import { Completer } from "./completion"
|
||||
import { LinterDefinition } from "./linting/linter"
|
||||
import { basicSetup, baseTheme, baseHighlightStyle } from "./themes/baseTheme"
|
||||
import { HoppEnvironmentPlugin } from "./extensions/HoppEnvironment"
|
||||
import { IndentedLineWrapPlugin } from "./extensions/IndentedLineWrap"
|
||||
// TODO: Migrate from legacy mode
|
||||
|
||||
type ExtendedEditorConfig = {
|
||||
@@ -237,7 +238,7 @@ export function useCodemirror(
|
||||
),
|
||||
lineWrapping.of(
|
||||
options.extendedEditorConfig.lineWrapping
|
||||
? [EditorView.lineWrapping]
|
||||
? [IndentedLineWrapPlugin]
|
||||
: []
|
||||
),
|
||||
keymap.of([
|
||||
@@ -324,7 +325,7 @@ export function useCodemirror(
|
||||
(newMode) => {
|
||||
view.value?.dispatch({
|
||||
effects: lineWrapping.reconfigure(
|
||||
newMode ? [EditorView.lineWrapping] : []
|
||||
newMode ? [EditorView.lineWrapping, IndentedLineWrapPlugin] : []
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user