Merge pull request #660 from clintonbloodworth/master

Closes #535. Do not restore editor positions if editor is destroyed.
This commit is contained in:
Glavin Wiechert 2015-11-14 13:34:24 -04:00
commit 24b11f599e
1 changed files with 12 additions and 11 deletions

View File

@ -430,17 +430,18 @@ handleSaveEvent = ->
posArray = getCursors(editor)
origScrollTop = editor.getScrollTop()
beautifyFilePath(filePath, ->
buffer.reload()
logger.verbose('restore editor positions', posArray,origScrollTop)
# Let the scrollTop setting run after all the save related stuff is run,
# otherwise setScrollTop is not working, probably because the cursor
# addition happens asynchronously
setTimeout ( ->
setCursors(editor, posArray)
editor.setScrollTop(origScrollTop)
# console.log "setScrollTop"
return
), 0
if editor.alive and editor.alive isnt false
buffer.reload()
logger.verbose('restore editor positions', posArray,origScrollTop)
# Let the scrollTop setting run after all the save related stuff is run,
# otherwise setScrollTop is not working, probably because the cursor
# addition happens asynchronously
setTimeout ( ->
setCursors(editor, posArray)
editor.setScrollTop(origScrollTop)
# console.log "setScrollTop"
return
), 0
)
)
plugin.subscriptions.add disposable