Skip to content

Commit

Permalink
🏁 🏁 🏁
Browse files Browse the repository at this point in the history
  • Loading branch information
sirkrypt0 authored Aug 7, 2020
2 parents 2287923 + 4fe5fbc commit 9b67bd1
Show file tree
Hide file tree
Showing 336 changed files with 808 additions and 907 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ initialHeading1Structure

^ RichTextStructure
new: #heading1
from: {RichTextStructure fromFont: (StrikeFont createDejaVuDark: 20). RichTextStructure bold}
from: {RichTextStructure fromFont: (StrikeFont createDejaVuDark: 20).
RichTextStructure bold}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ initialHeading2Structure

^ RichTextStructure
new: #heading2
from: {RichTextStructure fromFont: (StrikeFont createDejaVuDark: 17). RichTextStructure bold}
from: {RichTextStructure fromFont: (StrikeFont createDejaVuDark: 17).
RichTextStructure bold}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ initialHeading3Structure

^ RichTextStructure
new: #heading3
from: {RichTextStructure fromFont: (StrikeFont createDejaVuDark: 14). RichTextStructure bold}
from: {RichTextStructure fromFont: (StrikeFont createDejaVuDark: 14).
RichTextStructure bold}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ initialURLStructure

^ RichTextStructure
new: #url
from: {RichTextStructure autohyperlink. RichTextStructure underlined. RichTextStructure notExtendable}
from: {RichTextStructure autohyperlink.
RichTextStructure underlined.
RichTextStructure notExtendable}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"identifier" : "JEH 7/4/2020 11:17",
"initialBoldStructure" : "tok 8/7/2020 15:50",
"initialFootnoteStructure" : "tok 8/7/2020 15:50",
"initialHeading1Structure" : "tok 8/7/2020 15:50",
"initialHeading2Structure" : "tok 8/7/2020 15:50",
"initialHeading3Structure" : "tok 8/7/2020 15:50",
"initialHeading1Structure" : "tok 8/7/2020 20:57",
"initialHeading2Structure" : "tok 8/7/2020 20:57",
"initialHeading3Structure" : "tok 8/7/2020 20:57",
"initialItalicStructure" : "tok 8/7/2020 15:51",
"initialListStructure" : "tok 8/7/2020 15:51",
"initialTextStructures" : "JEH 7/4/2020 11:16",
"initialURLStructure" : "tok 8/7/2020 15:51",
"initialURLStructure" : "tok 8/7/2020 20:57",
"initialUnderlinedStructure" : "tok 8/7/2020 15:51",
"textStructures" : "frc 7/15/2020 18:31" },
"instance" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
utilities
hasStructure: aSymbol for: aText from: start to: end

aText isEmpty
ifTrue: [^ false].

^ (aText runs copyFrom: start to: end) allSatisfy: [:attributes |
attributes anySatisfy: [:attribute |
attribute isTextStructure ifTrue: [
attribute structureIdentifier = aSymbol] ifFalse: [false]]]

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
comparing
hash

^ (((self textStructures hash) bitXor: (self text hash)) bitXor: (self name hash)) bitXor: (self timeLastSaved hash)
^ (((self textStructures hash)
bitXor: (self text hash))
bitXor: (self name hash))
bitXor: (self timeLastSaved hash)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
textRuns: anArray
textRuns: aRunArray

self text runs: anArray
self text runs: aRunArray
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
text structures
textStructureSymbols

^ self textStructures collect: [:each |
each structureIdentifier]
^ self textStructures collect: [:each | each structureIdentifier]
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
count
wordcount

| prev bool byteString|
| prev bool byteString |
byteString := self asByteArray.
prev := self emptyChars first.
^ (byteString count: [:each | bool := ((self emptyChars includes: each) not and: [
self emptyChars includes: prev]). prev := each. bool ])
^ (byteString count: [:each |
bool := ((self emptyChars includes: each) not and: [
self emptyChars includes: prev]).
prev := each. bool])
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"commonStructures" : "kh 6/21/2020 17:03",
"editorClass" : "ls 6/26/2019 17:33",
"fromText:withStructures:" : "ls 6/26/2019 17:31",
"hasStructure:forText:from:to:" : "frc 8/7/2020 11:27",
"hasStructure:for:from:to:" : "tok 8/7/2020 20:50",
"initialTextStructures" : "JEH 7/4/2020 11:19" },
"instance" : {
"=" : "frc 8/6/2020 20:01",
Expand All @@ -16,7 +16,7 @@
"createNewStructure:" : "ls 7/24/2019 15:24",
"dateLastSaved" : "tok 7/20/2020 14:10",
"emptyChars" : "frc 6/1/2020 13:43",
"hash" : "frc 8/7/2020 11:37",
"hash" : "tok 8/7/2020 20:29",
"initialize" : "ls 7/24/2019 15:10",
"initializeStructure:" : "tok 8/7/2020 15:51",
"initializeStructures" : "ls 7/24/2019 15:12",
Expand All @@ -35,13 +35,13 @@
"text:" : "MB 7/3/2019 19:29",
"textChanged" : "ls 7/24/2019 14:41",
"textRuns" : "lh 7/24/2019 17:14",
"textRuns:" : "frc 7/15/2020 17:53",
"textRuns:" : "tok 8/7/2020 20:30",
"textStructureAt:" : "tok 8/7/2020 15:53",
"textStructureSymbols" : "ls 7/24/2019 14:25",
"textStructureSymbols" : "tok 8/7/2020 20:30",
"textStructures" : "ls 6/26/2019 17:28",
"textStructures:" : "MB 7/3/2019 19:29",
"textStructuresDo:" : "ls 7/24/2019 21:29",
"timeLastSaved" : "frc 8/6/2020 20:07",
"timestampLastSaved" : "tok 7/20/2020 14:10",
"timestampLastSaved:" : "tok 7/20/2020 14:10",
"wordcount" : "frc 8/7/2020 12:04" } }
"wordcount" : "tok 8/7/2020 20:31" } }
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
stop conditions
beginOfStructure
| diff |

| diff |
self position + 1 > self readLimit ifTrue: [^ nil].
diff := self structureDifferenceBetween: self position + 1 and: self position.
^ diff isEmpty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"on:" : "kh 7/3/2020 19:29" },
"instance" : {
"beginOfStructure" : "OS 8/7/2020 09:58",
"beginOfStructure" : "tok 8/7/2020 20:32",
"currentCharacter" : "JEH 7/25/2020 12:51",
"endOfDocument" : "JEH 7/26/2020 17:14",
"endOfStructure" : "frc 8/1/2020 13:17",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ instance creation
initializeShiftCmdKeyShortcuts

super initializeShiftCmdKeyShortcuts.
self structureKeymap do:
[:char | shiftCmdActions at: char asciiValue + 1 put: #toggleStructureSelectionAt: ]
self structureKeymap do: [:char |
shiftCmdActions at: char asciiValue + 1 put: #toggleStructureSelectionAt:]


Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
constants
URLRegex

^ RxMatcher forString: '^https?\:\/\/([0-9a-zA-Z\-]+\.)*[0-9a-zA-Z]+(\/[0-9a-zA-Z\-\.\?\&\=\%]+)*$'
^ RxMatcher forString:
'^https?\:\/\/([0-9a-zA-Z\-]+\.)*[0-9a-zA-Z]+(\/[0-9a-zA-Z\-\.\?\&\=\%]+)*$'
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
input events
isStructureShortcut: aKeyboardEvent

^aKeyboardEvent controlKeyPressed and: [
aKeyboardEvent shiftPressed] and: [
self class structureKeymap includes: aKeyboardEvent keyCharacter]
^ aKeyboardEvent controlKeyPressed and: [
aKeyboardEvent shiftPressed] and: [
self class structureKeymap includes: aKeyboardEvent keyCharacter]
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ keyStroke: aKeyboardEvent

| returnValue |
returnValue := super keyStroke: aKeyboardEvent.
(self isNewCharacter: aKeyboardEvent)
ifTrue: [self model applyCurrentStructures].
(self class isCtrlA: aKeyboardEvent)
ifTrue: [self selectAll].
(self isStructureShortcut: aKeyboardEvent) ifFalse:
[self model precedingStructuresChanged].
(self isNewCharacter: aKeyboardEvent) ifTrue: [self model applyCurrentStructures].
(self class isCtrlA: aKeyboardEvent) ifTrue: [self selectAll].
(self isStructureShortcut: aKeyboardEvent)
ifFalse: [self model precedingStructuresChanged].
self model updateFooter.
^ returnValue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"initialize" : "AG 7/25/2019 13:10",
"initializeCmdKeyShortcuts" : "OS 5/6/2020 20:40",
"initializeShiftCmdKeyShortcuts" : "tok 8/7/2020 11:14",
"initializeShiftCmdKeyShortcuts" : "tok 8/7/2020 20:51",
"initializeShiftedYellowButtonMenu" : "AG 5/29/2019 18:39",
"initializeYellowButtonMenu" : "AG 5/29/2019 18:39",
"isCtrlA:" : "frc 8/7/2020 11:26",
Expand All @@ -11,15 +11,15 @@
"structureKeymap" : "tok 8/7/2020 11:13",
"structureKeymap:" : "frc 8/6/2020 19:39" },
"instance" : {
"URLRegex" : "kh 6/15/2020 10:42",
"URLRegex" : "tok 8/7/2020 20:32",
"clipboardContainsURL" : "kh 6/15/2020 13:32",
"crWithIndent:" : "OS 8/7/2020 09:49",
"initialize" : "JEH 8/3/2020 15:01",
"isNewCharacter:" : "tok 6/13/2020 12:03",
"isSpecialCharacter:" : "OS 6/12/2020 12:03",
"isStructureShortcut:" : "tok 8/7/2020 11:14",
"isStructureShortcut:" : "tok 8/7/2020 20:33",
"isValidCharacter:" : "tok 6/13/2020 12:04",
"keyStroke:" : "frc 8/7/2020 11:26",
"keyStroke:" : "tok 8/7/2020 20:33",
"mouseDown:" : "OS 8/6/2020 16:26",
"openStructureTypeIn" : "tok 8/3/2020 14:33",
"paste" : "kh 6/15/2020 13:32",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ yellowButtonMenuItems
{'paste...' translated. #pasteRecent}.
#-.
{'save (s)' translated. #saveText}.
{'save as' translated. #saveDocumentInSaverWithNamePrompt}.
{'save as' translated. #saveDocumentWithNamePrompt}.
{'cancel (l)' translated. #cancel}.
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ accessing
bufferDocument: aRichTextDocument

bufferDocument := aRichTextDocument.
self textChanged;
self
textChanged;
noUnacceptedEdits
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ documentTimeText

self bufferDocument isUnsavedDocument
ifTrue: [^ 'unsaved document']
ifFalse: [^ 'last saved ', (self bufferDocument dateLastSaved), ' ', (self bufferDocument timeLastSaved)]
ifFalse: [^ 'last saved ', (self bufferDocument dateLastSaved), ' ',
(self bufferDocument timeLastSaved)]
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ hasStructure: aSymbol between: start to: end

^ self bufferDocument class
hasStructure: aSymbol
forText: self text
for: self text
from: start
to: end
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ importFileFrom: aFilePath
| fileStream text document |
fileStream := StandardFileStream readOnlyFileNamed: aFilePath.
text := Text fromString: fileStream contents.
document := self documentClass fromText: text withStructures: (self documentClass initialTextStructures).
document := self documentClass fromText: text
withStructures: (self documentClass initialTextStructures).
self setDocument: document.
fileStream close

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ initialize-release
initializeCompletionController

^ self wantsAutocompletion
ifTrue: [self addDependent: self createCompletionController]
ifFalse: [nil]
ifTrue: [self addDependent: self createCompletionController]
ifFalse: [nil]
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ loadDocumentFromSaver

| chosen document |
chosen := self chosenDocument.
chosen
ifNotNil: [
document := self saver loadDocumentFromName: chosen.
self setDocument: document;
setCurrentSave: chosen;
noUnacceptedEdits]
chosen ifNotNil: [
document := self saver loadDocumentFromName: chosen.
self setDocument: document;
setCurrentSave: chosen;
noUnacceptedEdits]
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ openDocumentMenu
^ self openMenuWith: {
{'New' . #openNewEditor}.
{'Save' . #saveText}.
{'Save as' . #saveDocumentInSaverWithNamePrompt}.
{'Save as' . #saveDocumentWithNamePrompt}.
{'Load' . #loadDocumentFromSaver}.
{'Import from File' . #importFileWithDialog}.
{'Import from Object File' . #importObjectFileWithDialog}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ openEditMenu
{'Undo (z)' . #undo}.
{'Redo (Z)' . #redo}.
{'Structures' . #openStructureEditor}.
{'Template'. #openTemplateChoser}
}
{'Template'. #openTemplateChoser}}
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ positionInTextAtIndex: anIndex

lineCounter := 0.
currentLine := self displayedLines
detect:
[: each | lineCounter := lineCounter + 1.
detect: [:each |
lineCounter := lineCounter + 1.
each first <= (anIndex + 1) and: [each last >= (anIndex + 1)]]
ifNone: [self displayedLines last].
positionInLine := anIndex - currentLine first + 2.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
toolbuilder
postBuildWith: aBuilder

self textView: (aBuilder widgetAt: 'textView').
self footer: (aBuilder widgetAt: 'footer').
self updateFooter.
self
textView: (aBuilder widgetAt: 'textView');
footer: (aBuilder widgetAt: 'footer');
updateFooter.
self editor model: self
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
text structure
removeTextAttribute: aTextAttribute

self bufferDocument
removeTextAttribute: aTextAttribute
from: self selectionStart
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
saving and loading
saveDocumentInSaverWithNamePrompt
saveDocumentWithNamePrompt

| name |
name := UIManager default request: 'Save as...'.
name = ''
ifFalse: [
self saver
addSave: self targetDocument
(name = '') ifFalse: [
self saver addSave: self targetDocument
underName: name.
self
self
setCurrentSave: name;
noUnacceptedEdits]
Loading

0 comments on commit 9b67bd1

Please sign in to comment.