mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Merge branch 'master' into asar
This commit is contained in:
@@ -768,7 +768,7 @@ class Atom extends Model
|
||||
callback(showSaveDialogSync())
|
||||
|
||||
showSaveDialogSync: (defaultPath) ->
|
||||
defaultPath ?= @project?.getPath()
|
||||
defaultPath ?= @project?.getPaths()[0]
|
||||
currentWindow = @getCurrentWindow()
|
||||
dialog = remote.require('dialog')
|
||||
dialog.showSaveDialog currentWindow, {title: 'Save File', defaultPath}
|
||||
|
||||
@@ -33,6 +33,10 @@ class AutoUpdateManager
|
||||
else
|
||||
autoUpdater = require 'auto-updater'
|
||||
|
||||
autoUpdater.on 'error', (event, message) =>
|
||||
@setState(ErrorState)
|
||||
console.error "Error Downloading Update: #{message}"
|
||||
|
||||
autoUpdater.setFeedUrl @feedUrl
|
||||
|
||||
autoUpdater.on 'checking-for-update', =>
|
||||
@@ -44,10 +48,6 @@ class AutoUpdateManager
|
||||
autoUpdater.on 'update-available', =>
|
||||
@setState(DownladingState)
|
||||
|
||||
autoUpdater.on 'error', (event, message) =>
|
||||
@setState(ErrorState)
|
||||
console.error "Error Downloading Update: #{message}"
|
||||
|
||||
autoUpdater.on 'update-downloaded', (event, releaseNotes, @releaseVersion) =>
|
||||
@setState(UpdateAvailableState)
|
||||
@emitUpdateAvailableEvent(@getWindows()...)
|
||||
|
||||
@@ -692,6 +692,7 @@ class DisplayBuffer extends Model
|
||||
targetLeft = pixelPosition.left
|
||||
defaultCharWidth = @defaultCharWidth
|
||||
row = Math.floor(targetTop / @getLineHeightInPixels())
|
||||
targetLeft = 0 if row < 0
|
||||
targetLeft = Infinity if row > @getLastRow()
|
||||
row = Math.min(row, @getLastRow())
|
||||
row = Math.max(0, row)
|
||||
|
||||
@@ -2,6 +2,7 @@ _ = require 'underscore-plus'
|
||||
{deprecate} = require 'grim'
|
||||
{specificity} = require 'clear-cut'
|
||||
{Subscriber} = require 'emissary'
|
||||
{Emitter} = require 'event-kit'
|
||||
FirstMate = require 'first-mate'
|
||||
{ScopeSelector} = FirstMate
|
||||
ScopedPropertyStore = require 'scoped-property-store'
|
||||
@@ -69,3 +70,7 @@ class GrammarRegistry extends FirstMate.GrammarRegistry
|
||||
propertiesForScope: (scope, keyPath) ->
|
||||
deprecate 'Use atom.config.getAll instead.'
|
||||
atom.config.settingsForScopeDescriptor(scope, keyPath)
|
||||
|
||||
clearObservers: ->
|
||||
@off()
|
||||
@emitter = new Emitter
|
||||
|
||||
@@ -843,7 +843,7 @@ class TextEditor extends Model
|
||||
mutateSelectedText: (fn) ->
|
||||
@mergeIntersectingSelections =>
|
||||
@transact =>
|
||||
fn(selection, index) for selection, index in @getSelections()
|
||||
fn(selection, index) for selection, index in @getSelectionsOrderedByBufferPosition()
|
||||
|
||||
# Move lines intersection the most recent selection up by one row in screen
|
||||
# coordinates.
|
||||
@@ -2621,7 +2621,7 @@ class TextEditor extends Model
|
||||
# Essential: For each selection, copy the selected text.
|
||||
copySelectedText: ->
|
||||
maintainClipboard = false
|
||||
for selection in @getSelections()
|
||||
for selection in @getSelectionsOrderedByBufferPosition()
|
||||
if selection.isEmpty()
|
||||
previousRange = selection.getBufferRange()
|
||||
selection.selectLine()
|
||||
|
||||
Reference in New Issue
Block a user