mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Make sure Haml::Buffer never errors out because of negative tab counts.
The code in there is complex enough that it's a good idea to be defensive here, even if we don't have any idea why negative tabs might actually come up.
This commit is contained in:
parent
21147927fd
commit
6f61019054
1 changed files with 1 additions and 1 deletions
|
@ -199,7 +199,7 @@ module Haml
|
|||
@@tab_cache = {}
|
||||
# Gets <tt>count</tt> tabs. Mostly for internal use.
|
||||
def tabs(count = 0)
|
||||
tabs = count + @tabulation
|
||||
tabs = [count + @tabulation, 0].max
|
||||
@@tab_cache[tabs] ||= ' ' * tabs
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue