You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a particular annoyance when going through an interactive web tutorial which lies in the auto-indenting of your code -- and by auto-indenting I mean to avoid pressing TAB.
In your interactive Ruby tutorial, and playground this was the case. To reproduce this bug, take for example the following uncompleted ruby playground environment, note the use of -> to mark indents.
def main
->5.times {|i|
->->puts i
-># ...
end
When I add the second curly brace } after the third line puts i, what I expect is one indent like ->} but what I get is the following
def main
->5.times {|i|
->->puts i
->->} # unnecessary indent
end
There is an extra indent, or in other words, a missing or faulty auto formatting.
How exactly did you guys implement your indentation, I wouldn't mind submitting a pull request.
The text was updated successfully, but these errors were encountered:
Thanks for reporting this issue. I've looked into this a little bit. The editor window uses a javascript library called codemirror. The minified and bundled version can be found in src/javascripts/vendor/codemirror-compressed-4.8.js. This version is quite old, current version is 5.42.
However the } de-indentation problem still seems to be present in the latest version (clone the codemirror repo, open mode/ruby/index.html). The keyword end is de-indented but } isn't.
Personally I'm not very eager to dive into codemirror code and fix this. But don't let that stop you :) I'm happy to update the vendored codemirror library.
There is a particular annoyance when going through an interactive web tutorial which lies in the auto-indenting of your code -- and by auto-indenting I mean to avoid pressing TAB.
In your interactive Ruby tutorial, and playground this was the case. To reproduce this bug, take for example the following uncompleted ruby playground environment, note the use of
->
to mark indents.When I add the second curly brace
}
after the third lineputs i
, what I expect is one indent like->}
but what I get is the followingThere is an extra indent, or in other words, a missing or faulty auto formatting.
How exactly did you guys implement your indentation, I wouldn't mind submitting a pull request.
The text was updated successfully, but these errors were encountered: