mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Only use the LaTeX indent service for when inserting a line break (#21530)
GitOrigin-RevId: 15c5e5afdee59badc833fe2deb13a80b3c409862
This commit is contained in:
+2
-6
@@ -1,13 +1,9 @@
|
||||
import { EditorState } from '@codemirror/state'
|
||||
import {
|
||||
getIndentation,
|
||||
IndentContext,
|
||||
indentString,
|
||||
} from '@codemirror/language'
|
||||
import { IndentContext, indentString } from '@codemirror/language'
|
||||
|
||||
export const createListItem = (state: EditorState, pos: number) => {
|
||||
const cx = new IndentContext(state)
|
||||
const columns = getIndentation(cx, pos) ?? 0
|
||||
const columns = cx.lineIndent(pos)
|
||||
const indent = indentString(state, columns)
|
||||
return `${indent}\\item `
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user