line-tree 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/line-tree.rb +1 -1
  2. metadata +1 -1
data/lib/line-tree.rb CHANGED
@@ -36,7 +36,6 @@ class LineTree
36
36
  indent, xr = build_branch(a, new_a, cur_indent, prev_indent, x, history )
37
37
 
38
38
  if xr then
39
- history.pop
40
39
  cur_indent, xr = build_branch(a, history[-1] || new_a, indent, prev_indent, xr, history )
41
40
  return [cur_indent, xr] if xr
42
41
  end
@@ -59,6 +58,7 @@ class LineTree
59
58
  build_tree(a, new_inner_a, cur_indent, history)
60
59
  else
61
60
  # revert to the earlier new_a
61
+ history.pop unless history.length <= 1
62
62
  return [cur_indent, x]
63
63
  end
64
64
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: line-tree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors: []
7
7