mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 18:24:09 +03:00
Rename editor.autoIndentPastedText to editor.autoIndentOnPaste
This commit is contained in:
parent
d2521ca8b8
commit
d53572d54d
@ -1946,7 +1946,7 @@ describe "EditSession", ->
|
||||
editSession.indent()
|
||||
expect(editSession.lineForBufferRow(2)).toBe " "
|
||||
|
||||
describe "editor.autoIndentPastedText", ->
|
||||
describe "editor.autoIndentOnPaste", ->
|
||||
it "does not auto-indent pasted text by default", ->
|
||||
editSession.setCursorBufferPosition([2, 0])
|
||||
editSession.insertText("0\n 2\n 4\n")
|
||||
@ -1958,8 +1958,8 @@ describe "EditSession", ->
|
||||
expect(editSession.lineForBufferRow(3)).toBe " 2"
|
||||
expect(editSession.lineForBufferRow(4)).toBe " 4"
|
||||
|
||||
it "auto-indents pasted text when editor.autoIndentPastedText is true", ->
|
||||
config.set("editor.autoIndentPastedText", true)
|
||||
it "auto-indents pasted text when editor.autoIndentOnPaste is true", ->
|
||||
config.set("editor.autoIndentOnPaste", true)
|
||||
editSession.setCursorBufferPosition([2, 0])
|
||||
editSession.insertText("0\n 2\n 4\n")
|
||||
editSession.getSelection().setBufferRange([[2,0], [5,0]])
|
||||
|
@ -161,7 +161,7 @@ class EditSession
|
||||
config.get("editor.autoIndent") ? true
|
||||
|
||||
shouldAutoIndentPastedText: ->
|
||||
config.get("editor.autoIndentPastedText") ? false
|
||||
config.get("editor.autoIndentOnPaste") ? false
|
||||
|
||||
insertText: (text, options={}) ->
|
||||
options.autoIndent ?= @shouldAutoIndent()
|
||||
@ -230,7 +230,6 @@ class EditSession
|
||||
[text, metadata] = pasteboard.read()
|
||||
_.extend(options, metadata) if metadata
|
||||
|
||||
console.log options
|
||||
@insertText(text, options)
|
||||
|
||||
undo: ->
|
||||
|
Loading…
Reference in New Issue
Block a user