Skip to content

Commit

Permalink
Merge pull request #1667 from girder/codemirror-tabs
Browse files Browse the repository at this point in the history
When in-line editing yaml and other files, the tab key now uses spaces
  • Loading branch information
manthey authored Oct 7, 2024
2 parents ba82d9a + 9d9232c commit fcbf6cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Handle a variation in a bioformats exception ([#1656](../../pull/1656))
- Increase logging slow histograms ([#1658](../../pull/1658))
- Use paginated item lists ([#1664](../../pull/1664))
- When in-line editing yaml and other files, the tab key now uses spaces ([#1667](../../pull/1667))

### Bug Fixes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,13 @@ var CodemirrorEditWidget = View.extend({
value: this._contents,
mode: Formats[this.mimeType].mode,
lineNumbers: true,
indentWithTabs: false,
extraKeys: {
Tab: function (cm) {
var spaces = Array(cm.getOption('tabSize') + 1).join(' ');
cm.replaceSelection(spaces);
}
},
gutters: ['CodeMirror-lint-markers'],
lint: true,
readOnly: this.accessLevel < AccessType.WRITE
Expand Down

0 comments on commit fcbf6cd

Please sign in to comment.