Skip to content

Commit

Permalink
Merge cherry-picked commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dabbler0 committed Jun 30, 2015
1 parent b7f0267 commit 145ce5d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/controller.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Y_KEY = 89

META_KEYS = [91, 92, 93, 223, 224]
CONTROL_KEYS = [17, 162, 163]
FLOATING_BLOCK_ALPHA = 0.75

userAgent = ''
if typeof(window) isnt 'undefined' and window.navigator?.userAgent
Expand Down Expand Up @@ -443,6 +444,9 @@ Editor::redrawMain = (opts = {}) ->
if opts.boundingRectangle?
@mainCtx.restore()

# Draw the cursor (if exists, and is inserted)
@redrawCursors(); @redrawHighlights()

for binding in editorBindings.redraw_main
binding.call this, layoutResult

Expand Down Expand Up @@ -782,7 +786,11 @@ Editor::replace = (before, after, updates) ->
Editor::correctCursor = ->
cursor = @tree.getFromLocation(@cursor)
unless @validCursorPosition cursor
@setCursor cursor
until @validCursorPosition(cursor) and cursor.type isnt 'socketStart'
cursor = cursor.next
until @validCursorPosition(cursor) and cursor.type isnt 'socketStart'
cursor = cursor.prev
@cursor = @toCrossDocumentLocation cursor

Editor::prepareNode = (node, context) ->
if node instanceof model.Container
Expand Down

0 comments on commit 145ce5d

Please sign in to comment.