@@ -33,66 +33,66 @@ export const focusEnd = async (holding = 1000): Promise<void> => {
3333 await holdDown ( target , { X : right + 1 , Y : top + height / 2 , holding } ) ;
3434} ;
3535
36- /** カーソルを左に動かす
36+ /** Move the cursor left using `ArrowLeft` key
3737 *
38- * @param [count=1] 動かす回数
38+ * @param [count=1] Number of moves to perform
3939 */
4040export const moveLeft = ( count = 1 ) : void => {
4141 for ( const _ of range ( 0 , count ) ) {
4242 press ( "ArrowLeft" ) ;
4343 }
4444} ;
45- /** カーソルを上に動かす
45+ /** Move the cursor up using `ArrowUp` key
4646 *
47- * @param [count=1] 動かす回数
47+ * @param [count=1] Number of moves to perform
4848 */
4949export const moveUp = ( count = 1 ) : void => {
5050 for ( const _ of range ( 0 , count ) ) {
5151 press ( "ArrowUp" ) ;
5252 }
5353} ;
54- /** カーソルを下に動かす
54+ /** Move the cursor down using `ArrowDown` key
5555 *
56- * @param [count=1] 動かす回数
56+ * @param [count=1] Number of moves to perform
5757 */
5858export const moveDown = ( count = 1 ) : void => {
5959 for ( const _ of range ( 0 , count ) ) {
6060 press ( "ArrowDown" ) ;
6161 }
6262} ;
63- /** カーソルを右に動かす
63+ /** Move the cursor right using `ArrowRight` key
6464 *
65- * @param [count=1] 動かす回数
65+ * @param [count=1] Number of moves to perform
6666 */
6767export const moveRight = ( count = 1 ) : void => {
6868 for ( const _ of range ( 0 , count ) ) {
6969 press ( "ArrowRight" ) ;
7070 }
7171} ;
7272
73- /** インデントを除いた行頭に移動する */
73+ /** Move to the start of line excluding indentation */
7474export const goHeadWithoutBlank = ( ) : void => {
7575 press ( "End" ) ;
7676 press ( "Home" ) ;
7777} ;
78- /** 最後の非空白文字に移動する */
78+ /** Move to the last non-whitespace character */
7979export const goEndWithoutBlank = ( ) : void => {
8080 press ( "End" ) ;
8181 moveLeft (
8282 getText ( caret ( ) . position . line ) ?. match ?.( / ( \s * ) $ / ) ?. [ 1 ] ?. length ?? 0 ,
8383 ) ;
8484} ;
85- /** 行頭に移動する */
85+ /** Move to the start of line */
8686export const goHead = ( ) : void => {
8787 press ( "Home" ) ;
8888 press ( "Home" ) ;
8989} ;
90- /** 行末に移動する */
90+ /** Move to the end of line */
9191export const goEnd = ( ) : void => {
9292 press ( "End" ) ;
9393} ;
9494
95- /** 最初の行の行頭に移動する */
95+ /** Move to the start of the first line */
9696export const goHeadLine = async ( ) : Promise < void > => {
9797 const target = getHeadLineDOM ( ) ;
9898 if ( ! target ) throw Error ( ".line:first-of-type can't be found." ) ;
@@ -103,13 +103,13 @@ export const goHeadLine = async (): Promise<void> => {
103103 const { left, top } = charDOM . getBoundingClientRect ( ) ;
104104 await click ( target , { X : left , Y : top } ) ;
105105} ;
106- /** 最後の行の行末に移動する */
106+ /** Move to the end of the last line */
107107export const goLastLine = async ( ) : Promise < void > => {
108108 await _goLine ( getTailLineDOM ( ) ) ;
109109} ;
110- /** 任意の行の行末に移動する
110+ /** Move to the end of a specified line
111111 *
112- * @param value 移動したい行の行番号 or 行ID or 行のDOM
112+ * @param value Target line number, line ID, or { @linkcode HTMLElement}
113113 */
114114export const goLine = async (
115115 value : string | number | HTMLElement | undefined ,
@@ -160,9 +160,9 @@ const getVisibleLineCount = (): number => {
160160 return Math . round ( globalThis . innerHeight / clientHeight ) ;
161161} ;
162162
163- /** 半ページ上にスクロールする
163+ /** Scroll half a page up
164164 *
165- * @param [count=1] スクロール回数
165+ * @param [count=1] Number of scroll operations to perform
166166 */
167167export const scrollHalfUp = async ( count = 1 ) : Promise < void > => {
168168 const lineNo = getLineNo ( caret ( ) . position . line ) ;
@@ -174,9 +174,9 @@ export const scrollHalfUp = async (count = 1): Promise<void> => {
174174 ) ;
175175 await goLine ( Math . max ( index , 0 ) ) ;
176176} ;
177- /** 半ページ下にスクロールする
177+ /** Scroll half a page down
178178 *
179- * @param [count=1] スクロール回数
179+ * @param [count=1] Number of scroll operations to perform
180180 */
181181export const scrollHalfDown = async ( count = 1 ) : Promise < void > => {
182182 const lineNo = getLineNo ( caret ( ) . position . line ) ;
@@ -188,18 +188,18 @@ export const scrollHalfDown = async (count = 1): Promise<void> => {
188188 ) ;
189189 await goLine ( Math . min ( index , getLineCount ( ) - 1 ) ) ;
190190} ;
191- /** 1ページ上にスクロールする
191+ /** Scroll one page up using `PageUp` key
192192 *
193- * @param [count=1] スクロール回数
193+ * @param [count=1] Number of scroll operations to perform
194194 */
195195export const scrollUp = ( count = 1 ) : void => {
196196 for ( const _ of range ( 0 , count ) ) {
197197 press ( "PageUp" ) ;
198198 }
199199} ;
200- /** 1ページ下にスクロールする
200+ /** Scroll one page down using `PageDown` key
201201 *
202- * @param [count=1] スクロール回数
202+ * @param [count=1] Number of scroll operations to perform
203203 */
204204export const scrollDown = ( count = 1 ) : void => {
205205 for ( const _ of range ( 0 , count ) ) {
0 commit comments