11import { goHead , goLine } from "./motion.ts" ;
22import { press } from "./press.ts" ;
33import { getLineCount } from "./node.ts" ;
4- import { range } from "../.. /range.ts " ;
4+ import { range } from "@core/iterutil /range" ;
55import { textInput } from "./dom.ts" ;
66import { isArray } from "@core/unknownutil/is/array" ;
77import { isNumber } from "@core/unknownutil/is/number" ;
@@ -10,24 +10,24 @@ import type { Scrapbox } from "@cosense/types/userscript";
1010declare const scrapbox : Scrapbox ;
1111
1212export const undo = ( count = 1 ) : void => {
13- for ( const _ of range ( 0 , count ) ) {
13+ for ( const _ of range ( 1 , count ) ) {
1414 press ( "z" , { ctrlKey : true } ) ;
1515 }
1616} ;
1717export const redo = ( count = 1 ) : void => {
18- for ( const _ of range ( 0 , count ) ) {
18+ for ( const _ of range ( 1 , count ) ) {
1919 press ( "z" , { shiftKey : true , ctrlKey : true } ) ;
2020 }
2121} ;
2222
2323export const insertIcon = ( count = 1 ) : void => {
24- for ( const _ of range ( 0 , count ) ) {
24+ for ( const _ of range ( 1 , count ) ) {
2525 press ( "i" , { ctrlKey : true } ) ;
2626 }
2727} ;
2828
2929export const insertTimestamp = ( index = 1 ) : void => {
30- for ( const _ of range ( 0 , index ) ) {
30+ for ( const _ of range ( 1 , index ) ) {
3131 press ( "t" , { altKey : true } ) ;
3232 }
3333} ;
@@ -94,12 +94,12 @@ export const deleteLines = async (
9494} ;
9595
9696export const indentLines = ( count = 1 ) : void => {
97- for ( const _ of range ( 0 , count ) ) {
97+ for ( const _ of range ( 1 , count ) ) {
9898 press ( "ArrowRight" , { ctrlKey : true } ) ;
9999 }
100100} ;
101101export const outdentLines = ( count = 1 ) : void => {
102- for ( const _ of range ( 0 , count ) ) {
102+ for ( const _ of range ( 1 , count ) ) {
103103 press ( "ArrowLeft" , { ctrlKey : true } ) ;
104104 }
105105} ;
@@ -120,23 +120,23 @@ export const moveLinesBefore = (from: number, to: number): void => {
120120 }
121121} ;
122122export const upLines = ( count = 1 ) : void => {
123- for ( const _ of range ( 0 , count ) ) {
123+ for ( const _ of range ( 1 , count ) ) {
124124 press ( "ArrowUp" , { ctrlKey : true } ) ;
125125 }
126126} ;
127127export const downLines = ( count = 1 ) : void => {
128- for ( const _ of range ( 0 , count ) ) {
128+ for ( const _ of range ( 1 , count ) ) {
129129 press ( "ArrowDown" , { ctrlKey : true } ) ;
130130 }
131131} ;
132132
133133export const indentBlocks = ( count = 1 ) : void => {
134- for ( const _ of range ( 0 , count ) ) {
134+ for ( const _ of range ( 1 , count ) ) {
135135 press ( "ArrowRight" , { altKey : true } ) ;
136136 }
137137} ;
138138export const outdentBlocks = ( count = 1 ) : void => {
139- for ( const _ of range ( 0 , count ) ) {
139+ for ( const _ of range ( 1 , count ) ) {
140140 press ( "ArrowLeft" , { altKey : true } ) ;
141141 }
142142} ;
@@ -148,12 +148,12 @@ export const moveBlocks = (count: number): void => {
148148 }
149149} ;
150150export const upBlocks = ( count = 1 ) : void => {
151- for ( const _ of range ( 0 , count ) ) {
151+ for ( const _ of range ( 1 , count ) ) {
152152 press ( "ArrowUp" , { altKey : true } ) ;
153153 }
154154} ;
155155export const downBlocks = ( count = 1 ) : void => {
156- for ( const _ of range ( 0 , count ) ) {
156+ for ( const _ of range ( 1 , count ) ) {
157157 press ( "ArrowDown" , { altKey : true } ) ;
158158 }
159159} ;
0 commit comments