mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-11 16:09:57 +03:00
💄
This commit is contained in:
parent
65b0107811
commit
c9b9e30848
@ -442,3 +442,9 @@ class Editor extends View
|
||||
unsubscribeFromBuffer: ->
|
||||
@buffer.off ".editor#{@id}"
|
||||
@renderer.destroy()
|
||||
|
||||
stateForScreenRow: (row) ->
|
||||
@renderer.lineForRow(row).state
|
||||
|
||||
getCurrentMode: ->
|
||||
@buffer.getMode()
|
@ -85,12 +85,13 @@ class Selection extends View
|
||||
|
||||
autoIndentText: (text) ->
|
||||
if @editor.autoIndent
|
||||
mode = @editor.getCurrentMode()
|
||||
row = @cursor.getScreenPosition().row
|
||||
state = @editor.renderer.lineForRow(row).state
|
||||
state = @editor.stateForScreenRow(row)
|
||||
if text[0] == "\n"
|
||||
indent = @editor.buffer.mode.getNextLineIndent(state, @cursor.getCurrentBufferLine(), atom.tabText)
|
||||
indent = mode.getNextLineIndent(state, @cursor.getCurrentBufferLine(), atom.tabText)
|
||||
text = text[0] + indent + text[1..]
|
||||
else if @editor.buffer.mode.checkOutdent(state, @cursor.getCurrentBufferLine(), text)
|
||||
else if mode.checkOutdent(state, @cursor.getCurrentBufferLine(), text)
|
||||
shouldOutdent = true
|
||||
|
||||
{text, shouldOutdent}
|
||||
@ -99,7 +100,7 @@ class Selection extends View
|
||||
screenRow = @cursor.getScreenPosition().row
|
||||
bufferRow = @cursor.getBufferPosition().row
|
||||
state = @editor.renderer.lineForRow(screenRow).state
|
||||
@editor.buffer.mode.autoOutdent(state, new AceOutdentAdaptor(@editor.buffer, @editor), bufferRow)
|
||||
@editor.getCurrentMode().autoOutdent(state, new AceOutdentAdaptor(@editor.buffer, @editor), bufferRow)
|
||||
|
||||
backspace: ->
|
||||
@selectLeft() if @isEmpty()
|
||||
|
Loading…
Reference in New Issue
Block a user