mirror of
https://github.com/atom/atom.git
synced 2026-02-13 16:14:59 -05:00
Merge remote-tracking branch 'origin/master' into dsandstrom-add-subword-cursors-4
This commit is contained in:
@@ -2481,13 +2481,14 @@ class TextEditor extends Model
|
||||
options.autoIndent ?= @shouldAutoIndent()
|
||||
@mutateSelectedText (selection) -> selection.indent(options)
|
||||
|
||||
# Constructs the string used for tabs.
|
||||
buildIndentString: (number, column=0) ->
|
||||
# Constructs the string used for indents.
|
||||
buildIndentString: (level, column=0) ->
|
||||
if @getSoftTabs()
|
||||
tabStopViolation = column % @getTabLength()
|
||||
_.multiplyString(" ", Math.floor(number * @getTabLength()) - tabStopViolation)
|
||||
_.multiplyString(" ", Math.floor(level * @getTabLength()) - tabStopViolation)
|
||||
else
|
||||
_.multiplyString("\t", Math.floor(number))
|
||||
excessWhitespace = _.multiplyString(' ', Math.round((level - Math.floor(level)) * @getTabLength()))
|
||||
_.multiplyString("\t", Math.floor(level)) + excessWhitespace
|
||||
|
||||
###
|
||||
Section: Grammars
|
||||
|
||||
Reference in New Issue
Block a user