mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Respect format-preserving options in TextEditor.pasteText
This commit is contained in:
@@ -3247,12 +3247,13 @@ class TextEditor extends Model
|
||||
# corresponding clipboard selection text.
|
||||
#
|
||||
# * `options` (optional) See {Selection::insertText}.
|
||||
pasteText: (options={}) ->
|
||||
pasteText: (options) ->
|
||||
options = Object.assign({}, options)
|
||||
{text: clipboardText, metadata} = @constructor.clipboard.readWithMetadata()
|
||||
return false unless @emitWillInsertTextEvent(clipboardText)
|
||||
|
||||
metadata ?= {}
|
||||
options.autoIndent = @shouldAutoIndentOnPaste()
|
||||
options.autoIndent ?= @shouldAutoIndentOnPaste()
|
||||
|
||||
@mutateSelectedText (selection, index) =>
|
||||
if metadata.selections?.length is @getSelections().length
|
||||
|
||||
Reference in New Issue
Block a user