TTkTextDocumentπΆοΈ
- class TTkTextDocument(*, text: TTkString = ' ')[source]πΆοΈ
Bases:
object
Undo,Redo Logic
Old:
_snapshotId: = last saved/undo/redo state 3 = doc4 _snapshots: [doc1, doc2, doc3, doc4, doc5, doc6, . . .]
New:
SnapshotId: 2 Snapshots: _lastSnap _dataLines (unstaged) βββββ βββββ βββββ βββββ βββββ βββββ β 0 β β 1 β β 2 β β 3 β β 4 β β 5 β βββββ βββββ βββββ βββββ βββββ βββββ Cursors: c0, c1, c2, c3, c4 = _lastCursor Diffs: [ d01, d12, d23, d34 ] = Forward Diffs [ d10, d21, d32, d43 ] = Backward Diffs Slices: = common txt slices between snapshots [ s01, s12, s23, s34 ]
Data Structure βββββββββββββββββ βββββββββββββββββ β Snapshot B β ββββββββββββββ>β Snapshot C β βββββββββββββββββ’ β βββββββββββββββββ’ β _nextDiff ββββββββ β β _nextDiff ββββ> Next snapshot βββββ _prevDiff β β β βββββ _prevDiff β or Null if at the end β βββββββββββββββββ β β β βββββββββββββββββ V A V β V βββββββββββββββββ β βββββββββββββββββ βββββββββββββββββ β Diff B->A β β β Diff B->C β β Diff C->B β βββββββββββββββββ’ β βββββββββββββββββ’ βββββββββββββββββ’ β slice = txtBA β β β slice = txtBC β β slice = txtBA β β snap β β β snap β β snap β βββββββββββββββββ β βββββββββββββββββ βββββββββββββββββ β β βββββββββββββββββββββββββββββββ
MethodsπΆοΈ
TTkTextDocument AttributesπΆοΈ
|
|
|
|
|
|
|
|
|
|
|
|
|