@@ -28,38 +28,6 @@ Class {
28
28
#category : #' Brick-Editor - Search'
29
29
}
30
30
31
- { #category : #' api - result' }
32
- BrEditorSearchTextMarkerContext >> computeNextItem [
33
- < return: #BrEditorSearchTextItem >
34
- | aNewIndex aNewItem anIndex aCurrentItem |
35
- aCurrentItem := self selectedItem.
36
- aCurrentItem ifNil: [ self ].
37
- anIndex := self patternItems identityIndexOf: aCurrentItem ifAbsent: [ self ].
38
- aNewIndex := anIndex + 1 .
39
- aNewIndex > self patternItems size ifTrue: [ aNewIndex := 1 ].
40
- aNewItem := self patternItems at: aNewIndex.
41
- aCurrentItem isSelected: false .
42
- aNewItem isSelected: true .
43
- selectedItem := aNewItem.
44
- ^ aNewItem
45
- ]
46
-
47
- { #category : #' api - result' }
48
- BrEditorSearchTextMarkerContext >> computePreviousItem [
49
- < return: #BrEditorSearchTextItem >
50
- | aNewIndex aNewItem anIndex aCurrentItem |
51
- aCurrentItem := self selectedItem.
52
- aCurrentItem ifNil: [ self ].
53
- anIndex := self patternItems identityIndexOf: aCurrentItem ifAbsent: [ self ].
54
- aNewIndex := anIndex - 1 .
55
- aNewIndex < 1 ifTrue: [ aNewIndex := self patternItems size ].
56
- aNewItem := self patternItems at: aNewIndex.
57
- aCurrentItem isSelected: false .
58
- aNewItem isSelected: true .
59
- selectedItem := aNewItem.
60
- ^ aNewItem
61
- ]
62
-
63
31
{ #category : #' api - accessing' }
64
32
BrEditorSearchTextMarkerContext >> editorModelText [
65
33
" Return a current editor model text.
@@ -167,6 +135,25 @@ BrEditorSearchTextMarkerContext >> selectedItem [
167
135
ifNone: [ nil ]
168
136
]
169
137
138
+ { #category : #' api - result' }
139
+ BrEditorSearchTextMarkerContext >> selectedItem: aBrEditorSearchTextItem [
140
+ self
141
+ assert: [ self patternItems isNotEmpty ]
142
+ description: [ ' There are no pattern items' ].
143
+
144
+ selectedItem
145
+ ifNotNil: [ :anItem |
146
+ self
147
+ assert: [ anItem isSelected not
7B8F
]
148
+ description: [ ' Currently selected item is still marked as selected' ] ].
149
+
150
+ self
151
+ assert: [ aBrEditorSearchTextItem isSelected ]
152
+ description: [ ' New selected item must be marked as selected' ].
153
+
154
+ selectedItem := aBrEditorSearchTextItem
155
+ ]
156
+
170
157
{ #category : #' api - result' }
171
158
BrEditorSearchTextMarkerContext >> selectedLine [
172
159
" Return line number for a given selected item"
0 commit comments