mirror of
https://github.com/atom/atom.git
synced 2026-02-07 05:05:02 -05:00
Add editor.autoIndentPastedText config option
This commit is contained in:
@@ -160,6 +160,9 @@ class EditSession
|
||||
shouldAutoIndent: ->
|
||||
config.get("editor.autoIndent") ? true
|
||||
|
||||
shouldAutoIndentPastedText: ->
|
||||
config.get("editor.autoIndentPastedText") ? false
|
||||
|
||||
insertText: (text, options={}) ->
|
||||
options.autoIndent ?= @shouldAutoIndent()
|
||||
@mutateSelectedText (selection) -> selection.insertText(text, options)
|
||||
@@ -220,12 +223,14 @@ class EditSession
|
||||
selection.copy(maintainPasteboard)
|
||||
maintainPasteboard = true
|
||||
|
||||
pasteText: (options={})->
|
||||
pasteText: (options={}) ->
|
||||
options.normalizeIndent ?= true
|
||||
options.autoIndent ?= @shouldAutoIndentPastedText()
|
||||
|
||||
[text, metadata] = pasteboard.read()
|
||||
_.extend(options, metadata) if metadata
|
||||
|
||||
console.log options
|
||||
@insertText(text, options)
|
||||
|
||||
undo: ->
|
||||
|
||||
Reference in New Issue
Block a user