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