MCPcopy Create free account
hub / github.com/SplootCode/splootcode / unindent

Method unindent

packages/editor/src/context/selection.ts:281–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

279
280 @action
281 unindent() {
282 const lineStartCursors = this.cursorMap.getLineStartCursorsForCursorPosition(this.cursor)
283
284 for (const startCursor of lineStartCursors) {
285 const unindentTarget = startCursor.listBlock.getUnindentTarget(startCursor.index)
286 if (unindentTarget) {
287 if (startCursor.listBlock.allowDelete()) {
288 startCursor.listBlock.childSet.removeChild(startCursor.index)
289 }
290 const newlineNode = getBlankFillForCategory(unindentTarget.listBlock.childSet.nodeCategory)
291 unindentTarget.listBlock.childSet.insertNode(newlineNode, unindentTarget.index)
292 return true
293 }
294 }
295 return false
296 }
297
298 @action
299 insertNewlineOrUnindent() {

Callers 1

Calls 6

getBlankFillForCategoryFunction · 0.90
getUnindentTargetMethod · 0.80
removeChildMethod · 0.80
allowDeleteMethod · 0.45
insertNodeMethod · 0.45

Tested by

no test coverage detected