@@ -198,9 +198,9 @@ open class VEditorNode: ASDisplayNode, ASTableDelegate, ASTableDataSource {
198198 . subscribe ( onNext: { [ weak self] indexPath in
199199 self ? . editorContents. remove ( at: indexPath. row)
200200 self ? . tableNode. deleteRows ( at: [ indexPath] , with: . automatic)
201- self ? . mergeTextContents ( target: . init ( row : indexPath. row - 1 ,
202- section : indexPath. section ) ,
203- to : indexPath,
201+ self ? . mergeTextContents ( target: indexPath,
202+ to : . init ( row : indexPath. row - 1 ,
203+ section : indexPath. section ) ,
204204 animated: false )
205205 } )
206206 . disposed ( by: cellNode. disposeBag)
@@ -589,12 +589,12 @@ open class VEditorNode: ASDisplayNode, ASTableDelegate, ASTableDataSource {
589589 }
590590
591591 // NOTE: make merged attributedText
592- var mutableAttrText = NSMutableAttributedString ( attributedString: targetAttributedText )
592+ var mutableAttrText = NSMutableAttributedString ( attributedString: sourceAttributedText )
593593 var newlineAttribute = self . editorRule. defaultAttribute ( )
594594 newlineAttribute [ VEditorAttributeKey] = [ self . editorRule. defaultStyleXMLTag]
595595 mutableAttrText. append ( NSAttributedString . init ( string: " \n " ,
596596 attributes: newlineAttribute) )
597- mutableAttrText. append ( sourceAttributedText )
597+ mutableAttrText. append ( targetAttributedText )
598598
599599 // NOTE: update editor
600600 self . editorContents. remove ( at: target. row)
@@ -629,8 +629,8 @@ open class VEditorNode: ASDisplayNode, ASTableDelegate, ASTableDataSource {
629629 . nodeForRow ( at: . init( row: indexPath. row,
630630 section: indexPath. section) ) as? VEditorTextCellNode
631631
632- guard let target = beforeCell ? . indexPath,
633- let to = currentCell ? . indexPath else {
632+ guard let target = currentCell ? . indexPath,
633+ let to = beforeCell ? . indexPath else {
634634 return
635635 }
636636
0 commit comments