Skip to content

Commit 44ec524

Browse files
committed
fix assigning unpaired paren face to all unpared parens
1 parent e34cc37 commit 44ec524

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/JuliaSyntaxHighlighting.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ function paren_type(k::Kind)
148148
end
149149

150150
mutable struct ParenDepthCounter
151-
paren::UInt
152-
bracket::UInt
153-
curly::UInt
151+
paren::Int
152+
bracket::Int
153+
curly::Int
154154
end
155155

156156
ParenDepthCounter() =

test/runtests.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@ astr_sum1to8 = Base.AnnotatedString("sum(1:8)")
2727

2828
# Check for string indexing issues
2929
@test Base.annotations(highlight("")) |> first |> first == 1:3
30+
31+
# Test unpaired parentheses (issue #17)
32+
unpaired_parens = highlight("(())))")
33+
@test Base.annotations(unpaired_parens)[5].value == :julia_unpaired_parentheses
34+
@test Base.annotations(unpaired_parens)[6].value == :julia_unpaired_parentheses

0 commit comments

Comments
 (0)