Add config option editor.normalizeIndentOnPaste

This commit is contained in:
probablycorey
2013-05-13 08:53:22 -07:00
parent 8e37d2ada6
commit 49aeef99b6
3 changed files with 55 additions and 41 deletions

View File

@@ -475,10 +475,11 @@ class EditSession
#
# options - A set of options equivalent to {Selection.insertText}.
pasteText: (options={}) ->
options.autoIndent ?= @shouldAutoIndentPastedText()
[text, metadata] = pasteboard.read()
_.extend(options, metadata) if metadata
options.autoIndent ?= @shouldAutoIndentPastedText()
if config.get('editor.normalizeIndentOnPaste') and metadata
options.indentBasis ?= metadata.indentBasis
@insertText(text, options)

View File

@@ -22,6 +22,7 @@ class Editor extends View
showLineNumbers: true
autoIndent: true
autoIndentOnPaste: false
normalizeIndentOnPaste: false
nonWordCharacters: "./\\()\"':,.;<>~!@#$%^&*|+=[]{}`~?-"
preferredLineLength: 80