MCPcopy Create free account
hub / github.com/editablejs/editable / setLineIndent

Function setLineIndent

packages/plugins/indent/src/utils.ts:16–26  ·  view source on GitHub ↗
(editor: Editor, blockEntry: NodeEntry<Indent>, size: number)

Source from the content-addressed store, hash-verified

14}
15
16export const setLineIndent = (editor: Editor, blockEntry: NodeEntry<Indent>, size: number) => {
17 const [block, path] = blockEntry
18 const lineIndent = block.lineIndent ?? 0
19 const textIndent = block.textIndent ?? 0
20 if (size < 0 && lineIndent === 0 && textIndent > 0) {
21 setTextIndent(editor, [block, path], size)
22 return
23 }
24 const indent = Math.max(lineIndent + size, 0)
25 Transforms.setNodes(editor, { lineIndent: indent } as Indent, { at: path })
26}

Callers 3

indent-editor.tsFile · 0.90
toggleNormalIndentFunction · 0.90
setTextIndentFunction · 0.85

Calls 1

setTextIndentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…