mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-05 05:34:30 +03:00
Merge branch 'master' into ns-editor-presenters
This commit is contained in:
commit
ba6d11e24e
@ -207,6 +207,7 @@ module.exports = (grunt) ->
|
|||||||
loadingGif: path.resolve(__dirname, '..', 'resources', 'win', 'loading.gif')
|
loadingGif: path.resolve(__dirname, '..', 'resources', 'win', 'loading.gif')
|
||||||
iconUrl: 'https://raw.githubusercontent.com/atom/atom/master/resources/win/atom.ico'
|
iconUrl: 'https://raw.githubusercontent.com/atom/atom/master/resources/win/atom.ico'
|
||||||
setupIcon: path.resolve(__dirname, '..', 'resources', 'win', 'atom.ico')
|
setupIcon: path.resolve(__dirname, '..', 'resources', 'win', 'atom.ico')
|
||||||
|
remoteReleases: 'https://atom.io/api/updates'
|
||||||
|
|
||||||
shell:
|
shell:
|
||||||
'kill-atom':
|
'kill-atom':
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
"fs-plus": "2.x",
|
"fs-plus": "2.x",
|
||||||
"github-releases": "~0.2.0",
|
"github-releases": "~0.2.0",
|
||||||
"grunt": "~0.4.1",
|
"grunt": "~0.4.1",
|
||||||
"grunt-atom-shell-installer": "^0.20.0",
|
"grunt-atom-shell-installer": "^0.21.0",
|
||||||
"grunt-cli": "~0.1.9",
|
"grunt-cli": "~0.1.9",
|
||||||
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe",
|
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe",
|
||||||
"grunt-contrib-coffee": "~0.12.0",
|
"grunt-contrib-coffee": "~0.12.0",
|
||||||
|
@ -68,7 +68,7 @@ getAssets = ->
|
|||||||
]
|
]
|
||||||
when 'win32'
|
when 'win32'
|
||||||
assets = [{assetName: 'atom-windows.zip', sourcePath: 'Atom'}]
|
assets = [{assetName: 'atom-windows.zip', sourcePath: 'Atom'}]
|
||||||
for squirrelAsset in ['AtomSetup.exe', 'RELEASES', "atom-#{version}-full.nupkg"]
|
for squirrelAsset in ['AtomSetup.exe', 'RELEASES', "atom-#{version}-full.nupkg", "atom-#{version}-delta.nupkg"]
|
||||||
cp path.join(buildDir, 'installer', squirrelAsset), path.join(buildDir, squirrelAsset)
|
cp path.join(buildDir, 'installer', squirrelAsset), path.join(buildDir, squirrelAsset)
|
||||||
assets.push({assetName: squirrelAsset, sourcePath: assetName})
|
assets.push({assetName: squirrelAsset, sourcePath: assetName})
|
||||||
assets
|
assets
|
||||||
|
@ -47,9 +47,8 @@ describe "the `atom` global", ->
|
|||||||
updateAvailableHandler.callCount > 0
|
updateAvailableHandler.callCount > 0
|
||||||
|
|
||||||
runs ->
|
runs ->
|
||||||
{releaseVersion, releaseNotes} = updateAvailableHandler.mostRecentCall.args[0]
|
{releaseVersion} = updateAvailableHandler.mostRecentCall.args[0]
|
||||||
expect(releaseVersion).toBe 'version'
|
expect(releaseVersion).toBe 'version'
|
||||||
expect(releaseNotes).toBe 'notes'
|
|
||||||
|
|
||||||
describe "loading default config", ->
|
describe "loading default config", ->
|
||||||
it 'loads the default core config', ->
|
it 'loads the default core config', ->
|
||||||
|
@ -377,6 +377,22 @@ describe "TextEditorComponent", ->
|
|||||||
expect(line2LeafNodes[2].textContent).toBe ' '
|
expect(line2LeafNodes[2].textContent).toBe ' '
|
||||||
expect(line2LeafNodes[2].classList.contains('indent-guide')).toBe true
|
expect(line2LeafNodes[2].classList.contains('indent-guide')).toBe true
|
||||||
|
|
||||||
|
it "renders indent guides correctly on lines containing only whitespace when invisibles are enabled", ->
|
||||||
|
atom.config.set 'editor.showInvisibles', true
|
||||||
|
atom.config.set 'editor.invisibles', space: '-', eol: 'x'
|
||||||
|
editor.getBuffer().insert([1, Infinity], '\n ')
|
||||||
|
nextAnimationFrame()
|
||||||
|
|
||||||
|
line2LeafNodes = getLeafNodes(component.lineNodeForScreenRow(2))
|
||||||
|
expect(line2LeafNodes.length).toBe 4
|
||||||
|
expect(line2LeafNodes[0].textContent).toBe '--'
|
||||||
|
expect(line2LeafNodes[0].classList.contains('indent-guide')).toBe true
|
||||||
|
expect(line2LeafNodes[1].textContent).toBe '--'
|
||||||
|
expect(line2LeafNodes[1].classList.contains('indent-guide')).toBe true
|
||||||
|
expect(line2LeafNodes[2].textContent).toBe '--'
|
||||||
|
expect(line2LeafNodes[2].classList.contains('indent-guide')).toBe true
|
||||||
|
expect(line2LeafNodes[3].textContent).toBe 'x'
|
||||||
|
|
||||||
it "does not render indent guides in trailing whitespace for lines containing non whitespace characters", ->
|
it "does not render indent guides in trailing whitespace for lines containing non whitespace characters", ->
|
||||||
editor.getBuffer().setText " hi "
|
editor.getBuffer().setText " hi "
|
||||||
nextAnimationFrame()
|
nextAnimationFrame()
|
||||||
|
@ -47,7 +47,7 @@ class AutoUpdateManager
|
|||||||
@setState(ErrorState)
|
@setState(ErrorState)
|
||||||
console.error "Error Downloading Update: #{message}"
|
console.error "Error Downloading Update: #{message}"
|
||||||
|
|
||||||
autoUpdater.on 'update-downloaded', (event, @releaseNotes, @releaseVersion) =>
|
autoUpdater.on 'update-downloaded', (event, releaseNotes, @releaseVersion) =>
|
||||||
@setState(UpdateAvailableState)
|
@setState(UpdateAvailableState)
|
||||||
@emitUpdateAvailableEvent(@getWindows()...)
|
@emitUpdateAvailableEvent(@getWindows()...)
|
||||||
|
|
||||||
@ -61,9 +61,9 @@ class AutoUpdateManager
|
|||||||
@setState(UnsupportedState)
|
@setState(UnsupportedState)
|
||||||
|
|
||||||
emitUpdateAvailableEvent: (windows...) ->
|
emitUpdateAvailableEvent: (windows...) ->
|
||||||
return unless @releaseVersion? and @releaseNotes
|
return unless @releaseVersion?
|
||||||
for atomWindow in windows
|
for atomWindow in windows
|
||||||
atomWindow.sendMessage('update-available', {@releaseVersion, @releaseNotes})
|
atomWindow.sendMessage('update-available', {@releaseVersion})
|
||||||
|
|
||||||
setState: (state) ->
|
setState: (state) ->
|
||||||
return if @state is state
|
return if @state is state
|
||||||
|
@ -173,8 +173,7 @@ LinesComponent = React.createClass
|
|||||||
innerHTML = ""
|
innerHTML = ""
|
||||||
|
|
||||||
scopeStack = []
|
scopeStack = []
|
||||||
firstTrailingWhitespacePosition = text.search(/\s*$/)
|
lineIsWhitespaceOnly = line.isOnlyWhitespace()
|
||||||
lineIsWhitespaceOnly = firstTrailingWhitespacePosition is 0
|
|
||||||
for token in tokens
|
for token in tokens
|
||||||
innerHTML += @updateScopeStack(scopeStack, token.scopes)
|
innerHTML += @updateScopeStack(scopeStack, token.scopes)
|
||||||
hasIndentGuide = indentGuidesVisible and (token.hasLeadingWhitespace() or (token.hasTrailingWhitespace() and lineIsWhitespaceOnly))
|
hasIndentGuide = indentGuidesVisible and (token.hasLeadingWhitespace() or (token.hasTrailingWhitespace() and lineIsWhitespaceOnly))
|
||||||
|
@ -9,6 +9,7 @@ idCounter = 1
|
|||||||
module.exports =
|
module.exports =
|
||||||
class TokenizedLine
|
class TokenizedLine
|
||||||
endOfLineInvisibles: null
|
endOfLineInvisibles: null
|
||||||
|
lineIsWhitespaceOnly: false
|
||||||
|
|
||||||
constructor: ({tokens, @lineEnding, @ruleStack, @startBufferColumn, @fold, @tabLength, @indentLevel, @invisibles}) ->
|
constructor: ({tokens, @lineEnding, @ruleStack, @startBufferColumn, @fold, @tabLength, @indentLevel, @invisibles}) ->
|
||||||
@startBufferColumn ?= 0
|
@startBufferColumn ?= 0
|
||||||
@ -146,7 +147,7 @@ class TokenizedLine
|
|||||||
markLeadingAndTrailingWhitespaceTokens: ->
|
markLeadingAndTrailingWhitespaceTokens: ->
|
||||||
firstNonWhitespaceIndex = @text.search(NonWhitespaceRegex)
|
firstNonWhitespaceIndex = @text.search(NonWhitespaceRegex)
|
||||||
firstTrailingWhitespaceIndex = @text.search(TrailingWhitespaceRegex)
|
firstTrailingWhitespaceIndex = @text.search(TrailingWhitespaceRegex)
|
||||||
lineIsWhitespaceOnly = firstTrailingWhitespaceIndex is 0
|
@lineIsWhitespaceOnly = firstTrailingWhitespaceIndex is 0
|
||||||
index = 0
|
index = 0
|
||||||
for token in @tokens
|
for token in @tokens
|
||||||
if index < firstNonWhitespaceIndex
|
if index < firstNonWhitespaceIndex
|
||||||
@ -202,12 +203,7 @@ class TokenizedLine
|
|||||||
false
|
false
|
||||||
|
|
||||||
isOnlyWhitespace: ->
|
isOnlyWhitespace: ->
|
||||||
if @text == ''
|
@lineIsWhitespaceOnly
|
||||||
true
|
|
||||||
else
|
|
||||||
for token in @tokens
|
|
||||||
return false unless token.isOnlyWhitespace()
|
|
||||||
true
|
|
||||||
|
|
||||||
tokenAtIndex: (index) ->
|
tokenAtIndex: (index) ->
|
||||||
@tokens[index]
|
@tokens[index]
|
||||||
|
@ -31,8 +31,8 @@ class WindowEventHandler
|
|||||||
atom.updateAvailable(detail)
|
atom.updateAvailable(detail)
|
||||||
|
|
||||||
# FIXME: Remove this when deprecations are removed
|
# FIXME: Remove this when deprecations are removed
|
||||||
{releaseVersion, releaseNotes} = detail
|
{releaseVersion} = detail
|
||||||
detail = [releaseVersion, releaseNotes]
|
detail = [releaseVersion]
|
||||||
if workspaceElement = atom.views.getView(atom.workspace)
|
if workspaceElement = atom.views.getView(atom.workspace)
|
||||||
atom.commands.dispatch workspaceElement, "window:update-available", detail
|
atom.commands.dispatch workspaceElement, "window:update-available", detail
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user