@@ -31,7 +31,7 @@ const setup = (
3131describe ( '.fwd1()' , ( ) => {
3232 test ( 'can use string root as initial point' , ( ) => {
3333 const { peritext, editor} = setup ( ) ;
34- const iterator = editor . fwd1 ( peritext . str . id ) ;
34+ const iterator = editor . fwd ( peritext . pointAbsStart ( ) ) ;
3535 let str = '' ;
3636 while ( 1 ) {
3737 const res = iterator ( ) ;
@@ -44,7 +44,7 @@ describe('.fwd1()', () => {
4444 test ( 'can iterate through the entire string' , ( ) => {
4545 const { peritext, editor} = setup ( ) ;
4646 const start = peritext . pointStart ( ) ! ;
47- const iterator = editor . fwd1 ( start . id ) ;
47+ const iterator = editor . fwd ( start ) ;
4848 let str = '' ;
4949 while ( 1 ) {
5050 const res = iterator ( ) ;
@@ -57,7 +57,7 @@ describe('.fwd1()', () => {
5757 test ( 'can iterate through the entire string, starting from ABS start' , ( ) => {
5858 const { peritext, editor} = setup ( ) ;
5959 const start = peritext . pointAbsStart ( ) ! ;
60- const iterator = editor . fwd1 ( start . id ) ;
60+ const iterator = editor . fwd ( start ) ;
6161 let str = '' ;
6262 while ( 1 ) {
6363 const res = iterator ( ) ;
@@ -70,7 +70,7 @@ describe('.fwd1()', () => {
7070 test ( 'can iterate through the entire string, with initial chunk provided' , ( ) => {
7171 const { peritext, editor} = setup ( ) ;
7272 const start = peritext . pointStart ( ) ! ;
73- const iterator = editor . fwd1 ( start . id , start . chunk ( ) ) ;
73+ const iterator = editor . fwd ( start ) ;
7474 let str = '' ;
7575 while ( 1 ) {
7676 const res = iterator ( ) ;
@@ -83,7 +83,7 @@ describe('.fwd1()', () => {
8383 test ( 'can iterate starting in the middle of first chunk' , ( ) => {
8484 const { peritext, editor} = setup ( ) ;
8585 const start = peritext . pointAt ( 2 ) ;
86- const iterator = editor . fwd1 ( start . id ) ;
86+ const iterator = editor . fwd ( start ) ;
8787 let str = '' ;
8888 while ( 1 ) {
8989 const res = iterator ( ) ;
@@ -96,7 +96,7 @@ describe('.fwd1()', () => {
9696 test ( 'can iterate starting in the middle of first chunk, with initial chunk provided' , ( ) => {
9797 const { peritext, editor} = setup ( ) ;
9898 const start = peritext . pointAt ( 2 ) ;
99- const iterator = editor . fwd1 ( start . id , start . chunk ( ) ) ;
99+ const iterator = editor . fwd ( start ) ;
100100 let str = '' ;
101101 while ( 1 ) {
102102 const res = iterator ( ) ;
@@ -109,7 +109,7 @@ describe('.fwd1()', () => {
109109 test ( 'can iterate starting in the middle of second chunk' , ( ) => {
110110 const { peritext, editor} = setup ( ) ;
111111 const start = peritext . pointAt ( 6 ) ;
112- const iterator = editor . fwd1 ( start . id ) ;
112+ const iterator = editor . fwd ( start ) ;
113113 let str = '' ;
114114 while ( 1 ) {
115115 const res = iterator ( ) ;
@@ -122,7 +122,7 @@ describe('.fwd1()', () => {
122122 test ( 'can iterate starting in the middle of second chunk, with initial chunk provided' , ( ) => {
123123 const { peritext, editor} = setup ( ) ;
124124 const start = peritext . pointAt ( 6 ) ;
125- const iterator = editor . fwd1 ( start . id , start . chunk ( ) ) ;
125+ const iterator = editor . fwd ( start ) ;
126126 let str = '' ;
127127 while ( 1 ) {
128128 const res = iterator ( ) ;
@@ -140,7 +140,7 @@ describe('.fwd1()', () => {
140140 } ) ;
141141 peritext . overlay . refresh ( ) ;
142142 const start = peritext . pointAt ( 0 ) ;
143- const iterator = editor . fwd1 ( start . id , start . chunk ( ) ) ;
143+ const iterator = editor . fwd ( start ) ;
144144 let str = '' ;
145145 const bools : boolean [ ] = [ ] ;
146146 while ( 1 ) {
@@ -157,7 +157,7 @@ describe('.fwd1()', () => {
157157describe ( '.bwd1()' , ( ) => {
158158 test ( 'can use string root as initial point' , ( ) => {
159159 const { peritext, editor} = setup ( ) ;
160- const iterator = editor . bwd1 ( peritext . str . id ) ;
160+ const iterator = editor . bwd ( peritext . pointAbsEnd ( ) ) ;
161161 let str = '' ;
162162 while ( 1 ) {
163163 const res = iterator ( ) ;
@@ -170,7 +170,7 @@ describe('.bwd1()', () => {
170170 test ( 'can iterate through the entire string' , ( ) => {
171171 const { peritext, editor} = setup ( ) ;
172172 const end = peritext . pointEnd ( ) ! ;
173- const iterator = editor . bwd1 ( end . id ) ;
173+ const iterator = editor . bwd ( end ) ;
174174 let str = '' ;
175175 while ( 1 ) {
176176 const res = iterator ( ) ;
@@ -183,7 +183,7 @@ describe('.bwd1()', () => {
183183 test ( 'can iterate through the entire string, starting from ABS end' , ( ) => {
184184 const { peritext, editor} = setup ( ) ;
185185 const end = peritext . pointAbsEnd ( ) ! ;
186- const iterator = editor . bwd1 ( end . id ) ;
186+ const iterator = editor . bwd ( end ) ;
187187 let str = '' ;
188188 while ( 1 ) {
189189 const res = iterator ( ) ;
@@ -196,7 +196,7 @@ describe('.bwd1()', () => {
196196 test ( 'can iterate through the entire string, with initial chunk provided' , ( ) => {
197197 const { peritext, editor} = setup ( ) ;
198198 const end = peritext . pointEnd ( ) ! ;
199- const iterator = editor . bwd1 ( end . id , end . chunk ( ) ) ;
199+ const iterator = editor . bwd ( end ) ;
200200 let str = '' ;
201201 while ( 1 ) {
202202 const res = iterator ( ) ;
@@ -208,54 +208,54 @@ describe('.bwd1()', () => {
208208
209209 test ( 'can iterate starting in the middle of first chunk' , ( ) => {
210210 const { peritext, editor} = setup ( ) ;
211- const end = peritext . pointAt ( 2 ) ;
212- const iterator = editor . bwd1 ( end . id ) ;
211+ const point = peritext . pointAt ( 2 ) ;
212+ const iterator = editor . bwd ( point ) ;
213213 let str = '' ;
214214 while ( 1 ) {
215215 const res = iterator ( ) ;
216216 if ( ! res ) break ;
217217 str += res . view ( ) ;
218218 }
219- expect ( str ) . toBe ( '210 ' ) ;
219+ expect ( str ) . toBe ( '10 ' ) ;
220220 } ) ;
221221
222222 test ( 'can iterate starting in the middle of first chunk, with initial chunk provided' , ( ) => {
223223 const { peritext, editor} = setup ( ) ;
224- const end = peritext . pointAt ( 2 ) ;
225- const iterator = editor . bwd1 ( end . id , end . chunk ( ) ) ;
224+ const point = peritext . pointAt ( 2 ) ;
225+ const iterator = editor . bwd ( point ) ;
226226 let str = '' ;
227227 while ( 1 ) {
228228 const res = iterator ( ) ;
229229 if ( ! res ) break ;
230230 str += res . view ( ) ;
231231 }
232- expect ( str ) . toBe ( '210 ' ) ;
232+ expect ( str ) . toBe ( '10 ' ) ;
233233 } ) ;
234234
235235 test ( 'can iterate starting in the middle of second chunk' , ( ) => {
236236 const { peritext, editor} = setup ( ) ;
237- const end = peritext . pointAt ( 6 ) ;
238- const iterator = editor . bwd1 ( end . id ) ;
237+ const point = peritext . pointAt ( 6 ) ;
238+ const iterator = editor . bwd ( point ) ;
239239 let str = '' ;
240240 while ( 1 ) {
241241 const res = iterator ( ) ;
242242 if ( ! res ) break ;
243243 str += res . view ( ) ;
244244 }
245- expect ( str ) . toBe ( '6543210 ' ) ;
245+ expect ( str ) . toBe ( '543210 ' ) ;
246246 } ) ;
247247
248248 test ( 'can iterate starting in the middle of second chunk, with initial chunk provided' , ( ) => {
249249 const { peritext, editor} = setup ( ) ;
250- const end = peritext . pointAt ( 6 ) ;
251- const iterator = editor . bwd1 ( end . id , end . chunk ( ) ) ;
250+ const point = peritext . pointAt ( 6 ) ;
251+ const iterator = editor . bwd ( point ) ;
252252 let str = '' ;
253253 while ( 1 ) {
254254 const res = iterator ( ) ;
255255 if ( ! res ) break ;
256256 str += res . view ( ) ;
257257 }
258- expect ( str ) . toBe ( '6543210 ' ) ;
258+ expect ( str ) . toBe ( '543210 ' ) ;
259259 } ) ;
260260
261261 test ( 'returns true for block split chars' , ( ) => {
@@ -266,7 +266,7 @@ describe('.bwd1()', () => {
266266 } ) ;
267267 peritext . overlay . refresh ( ) ;
268268 const start = peritext . pointAt ( 3 ) ;
269- const iterator = editor . bwd1 ( start . id , start . chunk ( ) ) ;
269+ const iterator = editor . bwd ( start ) ;
270270 let str = '' ;
271271 const bools : boolean [ ] = [ ] ;
272272 while ( 1 ) {
0 commit comments