1
1
import { goHead , goLine } from "./motion.ts" ;
2
2
import { press } from "./press.ts" ;
3
3
import { getLineCount } from "./node.ts" ;
4
- import { range } from "../.. /range.ts " ;
4
+ import { range } from "@core/iterutil /range" ;
5
5
import { textInput } from "./dom.ts" ;
6
6
import { isArray } from "@core/unknownutil/is/array" ;
7
7
import { isNumber } from "@core/unknownutil/is/number" ;
@@ -10,24 +10,24 @@ import type { Scrapbox } from "@cosense/types/userscript";
10
10
declare const scrapbox : Scrapbox ;
11
11
12
12
export const undo = ( count = 1 ) : void => {
13
- for ( const _ of range ( 0 , count ) ) {
13
+ for ( const _ of range ( 1 , count ) ) {
14
14
press ( "z" , { ctrlKey : true } ) ;
15
15
}
16
16
} ;
17
17
export const redo = ( count = 1 ) : void => {
18
- for ( const _ of range ( 0 , count ) ) {
18
+ for ( const _ of range ( 1 , count ) ) {
19
19
press ( "z" , { shiftKey : true , ctrlKey : true } ) ;
20
20
}
21
21
} ;
22
22
23
23
export const insertIcon = ( count = 1 ) : void => {
24
- for ( const _ of range ( 0 , count ) ) {
24
+ for ( const _ of range ( 1 , count ) ) {
25
25
press ( "i" , { ctrlKey : true } ) ;
26
26
}
27
27
} ;
28
28
29
29
export const insertTimestamp = ( index = 1 ) : void => {
30
- for ( const _ of range ( 0 , index ) ) {
30
+ for ( const _ of range ( 1 , index ) ) {
31
31
press ( "t" , { altKey : true } ) ;
32
32
}
33
33
} ;
@@ -94,12 +94,12 @@ export const deleteLines = async (
94
94
} ;
95
95
96
96
export const indentLines = ( count = 1 ) : void => {
97
- for ( const _ of range ( 0 , count ) ) {
97
+ for ( const _ of range ( 1 , count ) ) {
98
98
press ( "ArrowRight" , { ctrlKey : true } ) ;
99
99
}
100
100
} ;
101
101
export const outdentLines = ( count = 1 ) : void => {
102
- for ( const _ of range ( 0 , count ) ) {
102
+ for ( const _ of range ( 1 , count ) ) {
103
103
press ( "ArrowLeft" , { ctrlKey : true } ) ;
104
104
}
105
105
} ;
@@ -120,23 +120,23 @@ export const moveLinesBefore = (from: number, to: number): void => {
120
120
}
121
121
} ;
122
122
export const upLines = ( count = 1 ) : void => {
123
- for ( const _ of range ( 0 , count ) ) {
123
+ for ( const _ of range ( 1 , count ) ) {
124
124
press ( "ArrowUp" , { ctrlKey : true } ) ;
125
125
}
126
126
} ;
127
127
export const downLines = ( count = 1 ) : void => {
128
- for ( const _ of range ( 0 , count ) ) {
128
+ for ( const _ of range ( 1 , count ) ) {
129
129
press ( "ArrowDown" , { ctrlKey : true } ) ;
130
130
}
131
131
} ;
132
132
133
133
export const indentBlocks = ( count = 1 ) : void => {
134
- for ( const _ of range ( 0 , count ) ) {
134
+ for ( const _ of range ( 1 , count ) ) {
135
135
press ( "ArrowRight" , { altKey : true } ) ;
136
136
}
137
137
} ;
138
138
export const outdentBlocks = ( count = 1 ) : void => {
139
- for ( const _ of range ( 0 , count ) ) {
139
+ for ( const _ of range ( 1 , count ) ) {
140
140
press ( "ArrowLeft" , { altKey : true } ) ;
141
141
}
142
142
} ;
@@ -148,12 +148,12 @@ export const moveBlocks = (count: number): void => {
148
148
}
149
149
} ;
150
150
export const upBlocks = ( count = 1 ) : void => {
151
- for ( const _ of range ( 0 , count ) ) {
151
+ for ( const _ of range ( 1 , count ) ) {
152
152
press ( "ArrowUp" , { altKey : true } ) ;
153
153
}
154
154
} ;
155
155
export const downBlocks = ( count = 1 ) : void => {
156
- for ( const _ of range ( 0 , count ) ) {
156
+ for ( const _ of range ( 1 , count ) ) {
157
157
press ( "ArrowDown" , { altKey : true } ) ;
158
158
}
159
159
} ;
0 commit comments