(editor: Editor, blockEntry: NodeEntry<Indent>, size: number)
| 14 | } |
| 15 | |
| 16 | export 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 | } |
no test coverage detected
searching dependent graphs…