-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor model #120
Refactor model #120
Changes from 1 commit
95a6b95
61d09ce
327426c
e51bcec
9f6bf74
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
text structure | ||
addExtendableStructures | ||
|
||
(self currentStructures | ||
(self selectedStructures | ||
collect: [:each | self symbolToStructure: each] | ||
thenSelect: [:each | each isExtendable]) do: [:each | self addAttribute: each] |
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 |
---|---|---|
@@ -1,8 +1,4 @@ | ||
text structure | ||
getStructureSelectionAt: anIndex | ||
|
||
| structures | | ||
|
||
self isIntervalNotEmpty ifTrue:[structures := self selectedStructures] | ||
ifFalse: [structures := self currentStructures]. | ||
^ structures includes: (self textStructureSymbols at: anIndex ifAbsent: false) | ||
^ self selectedStructures includes: (self textStructureSymbols at: anIndex ifAbsent: [^ false]) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
testing | ||
isCursorBetweenText | ||
|
||
^ self isIntervalEmpty and: [self isTextEmpty not] | ||
^ self isTextSelected and: [self isTextEmpty not] |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
testing | ||
isNoTextSelected | ||
|
||
^ self isTextSelected not |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
testing | ||
isTextSelected | ||
|
||
^ (self selectionInterval first > self selectionInterval last) |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
text structure | ||
removeAttribute: aTextAttribute | ||
|
||
self bufferDocument | ||
removeTextAttribute: aTextAttribute | ||
from: self selectionStart | ||
to: self selectionStop. | ||
self selectionChanged |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
change | ||
selectionChanged | ||
|
||
self selectedStructures: (self textStructureSymbols select: | ||
[:structure | self hasStructure: structure]) asSet. | ||
self isNoTextSelected ifTrue: [self selectedStructures: (self textStructureSymbols select: | ||
[:structure | self hasStructure: structure]) asSet.]. | ||
self changed: #allSelections |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
text structure | ||
structureSelectionAt: anIndex put: aBoolean | ||
|
||
| targetSymbol targetStructure | | ||
targetSymbol := self textStructureSymbols at: anIndex ifAbsent: [^self]. | ||
targetStructure := self textStructures at: anIndex ifAbsent: [^self]. | ||
(aBoolean and: [self isIntervalEmpty]) | ||
ifTrue: [self bufferedStructures add: targetSymbol. self debufferedStructures remove: targetSymbol ifAbsent: []]. | ||
(aBoolean and: [self isIntervalNotEmpty]) | ||
ifTrue: [self addAttribute: targetStructure]. | ||
(aBoolean not and: [self isIntervalEmpty]) | ||
ifTrue: [self debufferedStructures add: targetSymbol. self bufferedStructures remove: targetSymbol ifAbsent: []]. | ||
(aBoolean not and: [self isIntervalNotEmpty]) | ||
ifTrue: [self removeTextAttribute: targetStructure]. | ||
|
||
| targetSymbol | | ||
targetSymbol := self textStructureSymbols at: anIndex ifAbsent: [^ self]. | ||
aBoolean ifTrue: [self selectedStructures add: targetSymbol] | ||
ifFalse: [self selectedStructures remove: targetSymbol ifAbsent: []]. | ||
self updateSelectedText: aBoolean with: targetSymbol. | ||
self selectionChanged |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
as yet unclassified | ||
precedingStructuresChanged | ||
updateSelectedStructures | ||
|
||
self precedingStructures: (self textStructureSymbols select: | ||
self selectedStructures: (self textStructureSymbols select: | ||
[:structure | self hasStructure: structure between: self selectionStart to: self selectionStart]) asSet. | ||
self changed: #allSelections |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
as yet unclassified | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. categorize |
||
updateSelectedText: aBoolean with: targetSymbol | ||
|
||
self isTextSelected ifTrue: [^ self]. | ||
aBoolean ifTrue: [self addAttribute: (self symbolToStructure: targetSymbol)] | ||
ifFalse: [self removeTextAttribute: (self symbolToStructure: targetSymbol)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one dot to many