Merge remote-tracking branch 'origin/master' into dsandstrom-add-subword-cursors-4

This commit is contained in:
Nathan Sobo
2015-06-30 22:55:40 -05:00
10 changed files with 116 additions and 20 deletions

View File

@@ -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