mirror of
https://github.com/atom/atom.git
synced 2026-02-13 16:14:59 -05:00
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:
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user