Provide separate config option for auto-indent on paste

This way, this option (`autoIndentOnPaste`) can be turned off for
indentation-sensitive languages like coffeescript.
This commit is contained in:
Max Brunsfeld
2014-11-17 10:15:10 -08:00
parent 83040d13c7
commit 175a8b6968
3 changed files with 47 additions and 22 deletions

View File

@@ -2507,7 +2507,7 @@ class TextEditor extends Model
if containsNewlines or !@getLastCursor().hasPrecedingCharactersOnLine()
options.indentBasis ?= metadata.indentBasis
options.autoIndent = @shouldAutoIndent()
options.autoIndent = @shouldAutoIndentOnPaste()
@insertText(text, options)
# Public: For each selection, if the selection is empty, cut all characters
@@ -2724,6 +2724,9 @@ class TextEditor extends Model
shouldAutoIndent: ->
atom.config.get(@getRootScopeDescriptor(), "editor.autoIndent")
shouldAutoIndentOnPaste: ->
atom.config.get(@getRootScopeDescriptor(), "editor.autoIndentOnPaste")
shouldShowInvisibles: ->
not @mini and atom.config.get(@getRootScopeDescriptor(), 'editor.showInvisibles')