Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Lexical/Core/Nodes/ElementNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ open class ElementNode: Node {
return false
}

@discardableResult
open func collapseAtStart(selection: RangeSelection) throws -> Bool {
return false
}
Expand Down Expand Up @@ -462,4 +463,9 @@ open class ElementNode: Node {

return writableSelf
}

// Shadow root functionality not yet implemented in Lexical iOS.
public func isShadowRoot() -> Bool {
return false
}
}
5 changes: 5 additions & 0 deletions Lexical/Core/Nodes/TextNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,11 @@ open class TextNode: Node {
return node.style
}

public func setStyle(_ style: String) throws {
let writable = try getWritable()
writable.style = style
}

public func splitText(splitOffsets: [Int]) throws -> [TextNode] {
try errorOnReadOnly()
let textContent = getTextPart() as NSString
Expand Down
11 changes: 11 additions & 0 deletions Lexical/Core/Reconciler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ internal enum Reconciler {
fatalError("Cannot run reconciler on an editor with no text storage")
}

if editor.dirtyNodes.isEmpty,
editor.dirtyType == .noDirtyNodes,
let currentSelection = currentEditorState.selection,
let pendingSelection = pendingEditorState.selection,
currentSelection.isSelection(pendingSelection),
pendingSelection.dirty == false,
markedTextOperation == nil {
// should be nothing to reconcile
return
}

if let markedTextOperation, markedTextOperation.createMarkedText {
guard shouldReconcileSelection == false else {
editor.log(.reconciler, .warning, "should not reconcile selection whilst starting marked text!")
Expand Down
Loading