Skip to content

Commit ce26a4c

Browse files
committed
Fix parsing of a singular '-' character; update tests
1 parent 551ffa2 commit ce26a4c

7 files changed

+23
-3
lines changed

plugin/EasyGrep.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,7 @@ function! s:ParseCommandLine(argv)
20402040
let j += 1
20412041
continue
20422042
endif
2043-
if tok[0] == '-' && parseopts
2043+
if tok != "-" && tok[0] == '-' && parseopts
20442044
let tok = s:Trim(tok)
20452045
if tok =~ '-[0-9]\+'
20462046
let opts["count"] = tok[1:]

tests/simpleregex.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ GrepAdd -F +
5151
ResultListTag GrepAdd -F ,
5252
GrepAdd -F ,
5353

54-
"ResultListTag GrepAdd -F -
55-
"GrepAdd -F -
54+
ResultListTag GrepAdd -F -
55+
GrepAdd -F -
5656

5757
ResultListTag GrepAdd -F .
5858
GrepAdd -F .

tests/simpleregex_ack.ok

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ __simpleregex.in|64 col 0| 1:*
3232
__simpleregex.in|65 col 0| 1:+
3333
|1 col 1| GrepAdd -F ,
3434
__simpleregex.in|66 col 0| 1:,
35+
|1 col 1| GrepAdd -F -
36+
__simpleregex.in|53 col 0| 3:[a-c]
37+
__simpleregex.in|54 col 0| 3:[A-C]
38+
__simpleregex.in|67 col 0| 1:-
3539
|1 col 1| GrepAdd -F .
3640
__simpleregex.in|68 col 0| 1:.
3741
|1 col 1| GrepAdd -F /

tests/simpleregex_ag.ok

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
65|1 col 0| +
3333
|1 col 1| GrepAdd -F ,
3434
66|1 col 0| ,
35+
|1 col 1| GrepAdd -F -
36+
53|3 col 0| [a-c]
37+
54|3 col 0| [A-C]
38+
67|1 col 0| -
3539
|1 col 1| GrepAdd -F .
3640
68|1 col 0| .
3741
|1 col 1| GrepAdd -F /

tests/simpleregex_grep.ok

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
|0 col 0| 65:+
3333
|1 col 1| GrepAdd -F ,
3434
|0 col 0| 66:,
35+
|1 col 1| GrepAdd -F -
36+
|0 col 0| 53:[a-c]
37+
|0 col 0| 54:[A-C]
38+
|0 col 0| 67:-
3539
|1 col 1| GrepAdd -F .
3640
|0 col 0| 68:.
3741
|1 col 1| GrepAdd -F /

tests/simpleregex_pt.ok

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ __simpleregex.in|64 col 0| *
3232
__simpleregex.in|65 col 0| +
3333
|1 col 1| GrepAdd -F ,
3434
__simpleregex.in|66 col 0| ,
35+
|1 col 1| GrepAdd -F -
36+
__simpleregex.in|53 col 0| [a-c]
37+
__simpleregex.in|54 col 0| [A-C]
38+
__simpleregex.in|67 col 0| -
3539
|1 col 1| GrepAdd -F .
3640
__simpleregex.in|68 col 0| .
3741
|1 col 1| GrepAdd -F /

tests/simpleregex_vimgrep.ok

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ __simpleregex.in|64 col 1| *
3232
__simpleregex.in|65 col 1| +
3333
|1 col 1| GrepAdd -F ,
3434
__simpleregex.in|66 col 1| ,
35+
|1 col 1| GrepAdd -F -
36+
__simpleregex.in|53 col 3| [a-c]
37+
__simpleregex.in|54 col 3| [A-C]
38+
__simpleregex.in|67 col 1| -
3539
|1 col 1| GrepAdd -F .
3640
__simpleregex.in|68 col 1| .
3741
|1 col 1| GrepAdd -F /

0 commit comments

Comments
 (0)