Fix auto indent level adjustment

This commit is contained in:
1024jp 2019-01-12 01:47:31 +09:00
parent 51d44ec2fb
commit fc5fae18de
2 changed files with 5 additions and 2 deletions

View File

@ -5,7 +5,10 @@ Change Log
3.7.0-beta.4 (unreleased)
--------------------------
- Suppress blinking Edit menu when perform `^⇧↑` or `^⇧↓` shortcut.
### Fixes
- [beta] Suppress blinking Edit menu when perform `^⇧↑` or `^⇧↓` shortcut.
- [beta] Fix an issue where auto-inserted tab did not expand to spaces on auto indent level adjustment.

View File

@ -500,7 +500,7 @@ final class EditorTextView: NSTextView, Themable, CurrentLineHighlighting, Multi
self.isAutomaticIndentEnabled
else { return super.insertNewline(sender) }
let tab = self.isAutomaticTabExpansionEnabled ? "\t" : String(repeating: " ", count: self.tabWidth)
let tab = self.isAutomaticTabExpansionEnabled ? String(repeating: " ", count: self.tabWidth) : "\t"
let ranges = self.rangesForUserTextChange as? [NSRange] ?? [self.rangeForUserTextChange]
self.setSelectedRangesWithUndo(ranges)