Skip to content

Commit

Permalink
Fix bug with nested blocks ending too soon
Browse files Browse the repository at this point in the history
  • Loading branch information
rnorth committed Oct 15, 2018
1 parent c19f133 commit e6e5492
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
XML blocks
set lang based on extension
highlight matching line

7 changes: 4 additions & 3 deletions codeinclude/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def select(text,
i = i + 1
if block in line and delim_count <= 0:
delim_count = 0
delim_count += line.count("{")

delim_count += line.count("{")

if delim_count > 0:
selected_lines.append(i)
Expand All @@ -43,9 +44,9 @@ def select(text,
i = i + 1
if inside_block in line and delim_count <= 0:
delim_count = 0
delim_count += line.count("{")
first_line_of_block = True


delim_count += line.count("{")
delim_count -= line.count("}")

if delim_count > 0 and not first_line_of_block:
Expand Down

0 comments on commit e6e5492

Please sign in to comment.