-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
145 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
.../RichTextEditing-Core.package/RichTextEditorModel.class/instance/currentPositionInText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
document information | ||
currentPositionInText | ||
|
||
^ self positionInTextAtIndex: self selectionStart |
4 changes: 4 additions & 0 deletions
4
packages/RichTextEditing-Core.package/RichTextEditorModel.class/instance/displayedLines.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
accessing | ||
displayedLines | ||
|
||
^ self editor paragraph lines |
11 changes: 8 additions & 3 deletions
11
packages/RichTextEditing-Core.package/RichTextEditorModel.class/instance/footerText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
document information | ||
footerText | ||
|
||
| footerString| | ||
| footerString currentPositionInText| | ||
footerString := 'You are using SquidWord · '. | ||
footerString := (footerString, self bufferDocument wordcount), ' words · '. | ||
footerString := footerString, self documentTimeText. | ||
footerString := (footerString, self bufferDocument wordcount), ' words ·'. | ||
|
||
currentPositionInText := self currentPositionInText. | ||
footerString := (footerString, ' Line '), currentPositionInText y. | ||
footerString := (footerString, ' Col '), currentPositionInText x. | ||
footerString := footerString, ' · ' , self documentTimeText. | ||
|
||
^ footerString |
14 changes: 14 additions & 0 deletions
14
...RichTextEditing-Core.package/RichTextEditorModel.class/instance/positionInTextAtIndex..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
document information | ||
positionInTextAtIndex: anIndex | ||
|
||
| lineCounter currentLine positionInLine | | ||
|
||
lineCounter := 0. | ||
currentLine := self displayedLines | ||
detect: | ||
[: each | lineCounter := lineCounter + 1. | ||
each first <= (anIndex + 1) and: [each last >= (anIndex + 1)]] | ||
ifNone: [self displayedLines last]. | ||
positionInLine := anIndex - currentLine first + 2. | ||
|
||
^ positionInLine @ lineCounter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...chTextEditing-Tests.package/RichTextEditorTests.class/instance/footerContainsColNumber.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tests | ||
footerContainsColNumber | ||
|
||
^ self regExFoundInFooter: 'Col [0-9]+' | ||
|
5 changes: 5 additions & 0 deletions
5
...hTextEditing-Tests.package/RichTextEditorTests.class/instance/footerContainsLineNumber.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tests | ||
footerContainsLineNumber | ||
|
||
^ self regExFoundInFooter: 'Line [0-9]+' | ||
|
8 changes: 8 additions & 0 deletions
8
...s/RichTextEditing-Tests.package/RichTextEditorTests.class/instance/regExFoundInFooter..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
tests | ||
regExFoundInFooter: aRegEx | ||
|
||
| currentFooterText | | ||
|
||
currentFooterText := self editorModel footer textMorph text. | ||
^ (RxMatcher forString: aRegEx) search: currentFooterText | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...ting-Tests.package/RichTextEditorTests.class/instance/testUS62ColNumberIsShownInFooter.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tests | ||
testUS62ColNumberIsShownInFooter | ||
|
||
self assert: self footerContainsColNumber | ||
|
5 changes: 5 additions & 0 deletions
5
...ing-Tests.package/RichTextEditorTests.class/instance/testUS62LineNumberIsShownInFooter.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tests | ||
testUS62LineNumberIsShownInFooter | ||
|
||
self assert: self footerContainsLineNumber | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
packages/RichTextEditing-Tests.package/RichTextEditorTextTests.class/instance/moveCaret.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
utilities | ||
moveCaret | ||
|
||
self moveCaretMulipleTimesRight: 5. | ||
self moveCaretMulipleTimesLeft: 3 | ||
self moveCaretMultipleTimesRight: 5. | ||
self moveCaretMultipleTimesLeft: 3 |
4 changes: 0 additions & 4 deletions
4
...diting-Tests.package/RichTextEditorTextTests.class/instance/moveCaretMulipleTimesLeft..st
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
...iting-Tests.package/RichTextEditorTextTests.class/instance/moveCaretMulipleTimesRight..st
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
...iting-Tests.package/RichTextEditorTextTests.class/instance/moveCaretMultipleTimesLeft..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
utilities | ||
moveCaretMultipleTimesLeft: aNumber | ||
|
||
self enterCharacter: self leftArrowKey times: aNumber |
4 changes: 4 additions & 0 deletions
4
...ting-Tests.package/RichTextEditorTextTests.class/instance/moveCaretMultipleTimesRight..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
utilities | ||
moveCaretMultipleTimesRight: aNumber | ||
|
||
self enterCharacter: self rightArrowKey times: aNumber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../RichTextEditing-Tests.package/RichTextEditorTextTests.class/instance/multipleLineText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
constants | ||
multipleLineText | ||
|
||
^ 'This is a text | ||
that crosses | ||
multiple lines | ||
.' | ||
|
4 changes: 4 additions & 0 deletions
4
...ges/RichTextEditing-Tests.package/RichTextEditorTextTests.class/instance/rightArrowKey.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
utilities | ||
rightArrowKey | ||
|
||
^ Character arrowRight |
8 changes: 8 additions & 0 deletions
8
...chTextEditorTextTests.class/instance/testCorrectLineColNumberAtArbitraryPositionInText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
unit-tests | ||
testCorrectLineColNumberAtArbitraryPositionInText | ||
|
||
self | ||
enterStringOntoTextField: self multipleLineText; | ||
moveCaretToBeginningOfText; | ||
moveCaretMultipleTimesRight: (self standardText size + 22); | ||
assert: (self editorModel currentPositionInText) = (7@3) |
7 changes: 7 additions & 0 deletions
7
...sts.package/RichTextEditorTextTests.class/instance/testCorrectLineColNumberAtEndOfText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
unit-tests | ||
testCorrectLineColNumberAtEndOfText | ||
|
||
self | ||
enterStringOntoTextField: self multipleLineText; | ||
moveCaretToEndOfText; | ||
assert: (self editorModel currentPositionInText) = (2@7) |
7 changes: 7 additions & 0 deletions
7
...s.package/RichTextEditorTextTests.class/instance/testCorrectLineColNumberAtStartOfText.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
unit-tests | ||
testCorrectLineColNumberAtStartOfText | ||
|
||
self | ||
enterStringOntoTextField: self multipleLineText; | ||
moveCaretToBeginningOfText; | ||
assert: (self editorModel currentPositionInText) = (1@1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters