@@ -37,7 +37,7 @@ export class UiHandle {
3737 public pointX ( pos : number | Point < string > ) : [ x : number , rect : Rect ] | undefined {
3838 const txt = this . txt ;
3939 const point = typeof pos === 'number' ? txt . pointAt ( pos ) : pos ;
40- const rect = this . getPointRect ( point , point . anchor === Anchor . Before ? true : false ) ;
40+ const rect = this . getPointRect ( point , point . anchor === Anchor . Before ) ;
4141 if ( ! rect ) return ;
4242 const x = point . anchor === Anchor . Before ? rect . x : rect . x + rect . width ;
4343 return [ x , rect ] ;
@@ -47,7 +47,7 @@ export class UiHandle {
4747 const lineRect = line [ 0 ] [ 1 ] ;
4848 const lineX = lineRect . x ;
4949 let point = line [ 0 ] [ 0 ] . clone ( ) ;
50- let curr = point ;
50+ const curr = point ;
5151 let bestDiff = 1e9 ;
5252 const max = line [ 1 ] [ 0 ] . viewPos ( ) - line [ 0 ] [ 0 ] . viewPos ( ) ;
5353 if ( ! this . api . getCharRect ) return point ;
@@ -83,7 +83,7 @@ export class UiHandle {
8383 return [ curr , currRect ] ;
8484 } ;
8585 while ( true ) {
86- const next = curr . copy ( p => p . step ( right ? 1 : - 1 ) ) ;
86+ const next = curr . copy ( ( p ) => p . step ( right ? 1 : - 1 ) ) ;
8787 if ( ! next ) return prepareReturn ( ) ;
8888 const nextRect = this . getPointRect ( next , right ) ;
8989 if ( ! nextRect ) return prepareReturn ( ) ;
@@ -107,14 +107,14 @@ export class UiHandle {
107107 public getPrevLineInfo ( line : UiLineInfo ) : UiLineInfo | undefined {
108108 const [ [ left ] ] = line ;
109109 if ( left . isStart ( ) ) return ;
110- const point = left . copy ( p => p . step ( - 1 ) ) ;
110+ const point = left . copy ( ( p ) => p . step ( - 1 ) ) ;
111111 return this . getLineInfo ( point ) ;
112112 }
113113
114114 public getNextLineInfo ( line : UiLineInfo ) : UiLineInfo | undefined {
115115 const [ , [ right ] ] = line ;
116116 if ( right . viewPos ( ) >= this . txt . str . length ( ) ) return ;
117- const point = right . copy ( p => p . step ( 1 ) ) ;
117+ const point = right . copy ( ( p ) => p . step ( 1 ) ) ;
118118 return this . getLineInfo ( point ) ;
119119 }
120120}
0 commit comments