Skip to content

Commit 9a02af5

Browse files
authored
Merge commit from fork
1 parent daa71bc commit 9a02af5

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ function expand_(str: string, max: number, isTop: boolean): string[] {
170170
const y = numeric(n[1])
171171
const width = Math.max(n[0].length, n[1].length)
172172
let incr =
173-
n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1
173+
n.length === 3 && n[2] !== undefined ?
174+
Math.max(Math.abs(numeric(n[2])), 1)
175+
: 1
174176
let test = lte
175177
const reverse = y < x
176178
if (reverse) {

test/bash-results.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,10 +1081,8 @@ A{b,{d,e},{f,g}}Z
10811081
[a}b]><><><><{}{{},a}}b
10821082
[{}{}}b]
10831083
[{}a}b]><><><><{}a,b}c
1084-
[{}a,b}c]><><><><x{{a,b}}y
1085-
[x{a}y]
1086-
[x{b}y]><><><><x{b}y
1087-
[x{b}y]><><><><x{{b}}y
1088-
[x{{b}}y]><><><><src/{\[ui\],abc}/*.ts
1089-
src/\[ui\]/*.ts
1090-
src/abc/*.ts><><><><
1084+
[{}a,b}c]><><><><src/{[ui],abc}/*.ts
1085+
[src/[ui]/*.ts]
1086+
[src/abc/*.ts]><><><><{1..2..0}
1087+
[1]
1088+
[2]><><><><

test/cases.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,4 @@ y{},a}x
187187
{}a,b}c
188188
# make sure brackets work #87
189189
src/{\[ui\],abc}/*.ts
190+
{1..2..0}

0 commit comments

Comments
 (0)