Skip to content

Commit

Permalink
Make sure undo/redo restores the text correctly and simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sirkrypt0 committed Aug 3, 2020
1 parent 2a5b02a commit 26f20d9
Show file tree
Hide file tree
Showing 14 changed files with 16 additions and 77 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
undo/redo
openStructureTypeIn

"Close previous typeIn to store edited text and allow undo/redo of only the structure"
self closeTypeIn.
self openTypeIn

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@
"initializeShiftCmdKeyShortcuts" : "tok 5/18/2020 10:19",
"initializeShiftedYellowButtonMenu" : "AG 5/29/2019 18:39",
"initializeYellowButtonMenu" : "AG 5/29/2019 18:39",
"redoTextStructureMessageFor:" : "tok 7/24/2020 19:31",
"structureKeymap" : "tok 5/18/2020 10:18",
"undoTextStructureMessageFor:" : "tok 7/24/2020 19:30" },
"structureKeymap" : "tok 5/18/2020 10:18" },
"instance" : {
"URLRegex" : "kh 6/15/2020 10:42",
"addAttribute:from:to:" : "tok 8/3/2020 12:51",
"clipboardContainsURL" : "kh 6/15/2020 13:32",
"crWithIndent:" : "lh 7/24/2019 22:30",
"getParagraphCharacter" : "LM 5/26/2019 22:52",
"historyStart" : "tok 8/3/2020 13:03",
"historyStop" : "tok 8/3/2020 13:03",
"isCtrlA:" : "lh 7/24/2019 16:59",
"isNewCharacter:" : "tok 6/13/2020 12:03",
"isSpecialCharacter:" : "OS 6/12/2020 12:03",
Expand All @@ -24,11 +19,9 @@
"keyStroke:" : "OS 6/12/2020 12:09",
"makeTextURLFrom:" : "frc 7/16/2020 14:05",
"mouseDown:" : "frc 7/3/2020 19:37",
"openStructureTypeIn" : "tok 8/3/2020 14:33",
"paste" : "kh 6/15/2020 13:32",
"pasteURL" : "frc 7/3/2020 09:13",
"removeAttribute:from:to:" : "tok 8/3/2020 12:59",
"reselectAndRedoStructure:" : "tok 8/3/2020 13:04",
"reselectAndUndoStructure:" : "tok 8/3/2020 13:04",
"setEmphasisHere" : "6/1/2020 14:03:21",
"specialCharacters" : "tok 6/13/2020 12:14",
"storeSelectionInParagraph" : "lh 7/24/2019 21:51",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
text structure
addAttribute: aTextAttribute

self
self setTextFromView.
self bufferDocument
addAttribute: aTextAttribute
from: self selectionStart
to: self selectionStop

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
text structure
changeAttributesFor: aBoolean with: targetStructure

self editor openStructureTypeIn.
aBoolean
ifTrue: [self addAttribute: targetStructure.
self editor
addAttribute: targetStructure from: self selectionStart to: self selectionStop]
ifFalse: [self removeTextAttribute: targetStructure.
self editor
removeAttribute: targetStructure from: self selectionStart to: self selectionStop]
ifTrue: [self addAttribute: targetStructure]
ifFalse: [self removeTextAttribute: targetStructure].
self editor closeTypeIn
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"saverClass" : "ls 5/8/2019 20:28",
"yellowButtonMenuItems" : "tok 5/31/2020 20:54" },
"instance" : {
"addAttribute:" : "tok 8/3/2020 13:07",
"addAttribute:from:to:" : "tok 8/3/2020 13:06",
"addAttribute:" : "tok 8/3/2020 14:30",
"addExtendableStructures" : "kh 6/21/2020 10:03",
"applyCurrentStructures" : "OS 6/3/2020 22:35",
"bufferDocument" : "ls 6/26/2019 17:45",
Expand All @@ -26,7 +25,7 @@
"buildStructureListWith:" : "frc 6/16/2020 19:36",
"buildTextFieldWith:" : "frc 6/16/2020 19:35",
"buildWith:" : "frc 6/25/2020 16:23",
"changeAttributesFor:with:" : "tok 8/3/2020 13:01",
"changeAttributesFor:with:" : "tok 8/3/2020 14:35",
"changeBuffersFor:with:" : "tok 8/3/2020 12:47",
"chosenDocument" : "AG 7/25/2019 13:13",
"createNewStructure:" : "ls 7/24/2019 15:11",
Expand Down

0 comments on commit 26f20d9

Please sign in to comment.