Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set tab size in Ace editor to 2 #761

Merged
merged 4 commits into from
Feb 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

- Fixed an issue that prevented authors from using symbols, such as `T` or a variable, as the value of the `exercise` chunk option, which caused tutorials with chunks with `exercise = T` to fail to render (thanks @cknotz #757, #758).

- The embedded Ace editor used in learnr exercises now defaults to a tab width of 2, aligning with the Tidyverse style guide (#761).

# learnr 0.11.2

- Fixed an issue that prevented htmlwidgets from working in exercise code unless similar widgets were added to the tutorial prose (thanks @munoztd0 #744, #745).
Expand Down
2 changes: 1 addition & 1 deletion inst/lib/tutorial/tutorial.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions inst/lib/tutorial/tutorial.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions learnr-js/tutorial/tutorial.js
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ Tutorial.prototype.$attachAceEditor = function (target, code, options) {
editor.session.setMode(`ace/mode/${options.engine}`)
editor.session.getSelection().clearSelection()
editor.session.setNewLineMode('unix')
editor.session.setTabSize(2)
editor.setValue(code, -1)
editor.setOptions({
enableBasicAutocompletion: true
Expand Down