Skip to content

Commit

Permalink
Set tab size in Ace editor to 2 (rstudio#761)
Browse files Browse the repository at this point in the history
Co-authored-by: Garrick Aden-Buie <[email protected]>
  • Loading branch information
rossellhayes and gadenbuie authored Feb 21, 2023
1 parent e0a42bd commit b6669f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
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

0 comments on commit b6669f9

Please sign in to comment.