Skip to content

Commit e9b1713

Browse files
committed
GUI - syntax fix indentation of while do loops
``` y = 1 x = 2 while y<10 do y+=1 print y while x<20 do x+=y print x end end print y print x ``` Now indents correctly
1 parent d244a8e commit e9b1713

File tree

1 file changed

+6
-1
lines changed
  • app/server/ruby/vendor/ruby-beautify/lib/ruby-beautify/config

1 file changed

+6
-1
lines changed

app/server/ruby/vendor/ruby-beautify/lib/ruby-beautify/config/ruby.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
:nest_except => [:double_quote, :single_quote, :regex, :back_tick])
5353

5454
ruby.add_matcher(:standard,
55-
/((#{start_statement_boundary}(module|class|def))|#{pre_keyword_boundary}do#{post_keyword_boundary})/,
55+
/(#{start_statement_boundary}(module|class|def))/,
5656
/(((^|;|\s)end)|#{continue_statement_boundary}(rescue|ensure))\b/,
5757
:nest_except => [:double_quote, :regex, :backtick])
5858

@@ -61,6 +61,11 @@
6161
/(((^|;|\s)end)|#{continue_statement_boundary}(rescue|ensure))\b/,
6262
:nest_except => [:double_quote, :regex, :backtick])
6363

64+
ruby.add_matcher(:do,
65+
/#{pre_keyword_boundary}do#{post_keyword_boundary}/,
66+
/(((^|;|\s)end)|#{continue_statement_boundary}(rescue|ensure))\b/,
67+
:nest_except => [:double_quote, :regex, :backtick, :more])
68+
6469
ruby.add_matcher(:begin,
6570
/((#{start_statement_boundary}begin)|(#{continue_statement_boundary}(ensure|rescue)))\b/,
6671
/(((^|;|\s)end)|#{continue_statement_boundary}(rescue|ensure|else))\b/,

0 commit comments

Comments
 (0)