Comparar commits

..

5 Commits

Autor SHA1 Mensagem Data
Kevin Sawicki 8f8c0cbf45 Mention theme not found fix 2013-08-09 11:26:37 -07:00
Kevin Sawicki 7e04d85e1e Log a warning when a theme fails to load
Previously Atom would fail to launch if a theme referenced in
the config was not found.
2013-08-09 11:25:07 -07:00
Kevin Sawicki 136836e615 Allow non-existent files to be opened from fuzzy finder
The previous isFileSync check prevented unsaved buffers with a path to a
non-existent file from being opened from the fuzzy finder.

Now an error is only displayed if the selected path is a directory.

Closes #686
2013-08-09 10:31:40 -07:00
Matt Colyer 82882624ce Handle atom standard output from atom.sh 2013-08-09 10:23:05 -07:00
Kevin Sawicki c03e849089 Add missing dot in usage ellipsis 2013-08-09 10:10:39 -07:00
7 arquivos alterados com 48 adições e 19 exclusões
+2
Ver Arquivo
@@ -1,3 +1,5 @@
* Fixed: Atom failing to launch if the theme being used was not found
* Improved: Theme changes now immediately take effect
* Fixed: Wrap in quotes/parens now works in split panes
* Improved: Autocomplete now includes CSS property names and values
+27 -11
Ver Arquivo
@@ -1,5 +1,6 @@
#!/bin/sh
ATOM_PATH=/Applications/Atom.app
ATOM_BINARY=$ATOM_PATH/Contents/MacOS/Atom
if [ ! -d $ATOM_PATH ]; then sleep 5; fi # Wait for Atom to reappear, Sparkle may be replacing it.
@@ -8,7 +9,32 @@ if [ ! -d $ATOM_PATH ]; then
exit 1
fi
open -a $ATOM_PATH -n --args --executed-from="$(pwd)" --pid=$$ $@
while getopts ":whv-:" opt; do
case "$opt" in
-)
case "${OPTARG}" in
wait)
WAIT=1
;;
help|version)
EXPECT_OUTPUT=1
;;
esac
;;
w)
WAIT=1
;;
h|v)
EXPECT_OUTPUT=1
;;
esac
done
if [ $EXPECT_OUTPUT ]; then
$ATOM_BINARY --executed-from="$(pwd)" --pid=$$ $@
else
open -a $ATOM_PATH -n --args --executed-from="$(pwd)" --pid=$$ $@
fi
# Used to exit process when atom is used as $EDITOR
on_die() {
@@ -16,16 +42,6 @@ on_die() {
}
trap 'on_die' SIGQUIT SIGTERM
# Don't exit process if we were told to wait.
while [ "$#" -gt "0" ]; do
case $1 in
-W|--wait)
WAIT=1
;;
esac
shift
done
if [ $WAIT ]; then
while true; do
sleep 1
+7
Ver Arquivo
@@ -23,3 +23,10 @@ describe "ThemeManager", ->
config.set('core.themes', [])
expect($('style.userTheme').length).toBe 0
describe "when a theme fails to load", ->
it "logs a warning", ->
themeManager = new ThemeManager()
spyOn(console, 'warn')
themeManager.loadTheme('a-theme-that-will-not-be-found')
expect(console.warn).toHaveBeenCalled()
+5 -1
Ver Arquivo
@@ -27,7 +27,11 @@ class ThemeManager
@loadTheme(themeName) for themeName in themeNames
@loadUserStylesheet()
loadTheme: (name) -> @loadedThemes.push(new Theme(name))
loadTheme: (name) ->
try
@loadedThemes.push(new Theme(name))
catch error
console.warn("Failed to load theme #{name}", error.stack ? error)
getUserStylesheetPath: ->
stylesheetPath = fsUtils.resolve(path.join(config.configDirPath, 'user'), ['css', 'less'])
+1 -1
Ver Arquivo
@@ -59,7 +59,7 @@ parseCommandLine = ->
options.usage """
Atom #{version}
Usage: atom [options] [file ..]
Usage: atom [options] [file ...]
"""
options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.')
options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.')
@@ -98,13 +98,13 @@ class FuzzyFinderView extends SelectList
confirmed : ({filePath}) ->
return unless filePath
if fsUtils.isFileSync(filePath)
if fsUtils.isDirectorySync(filePath)
@setError('Selected path is a directory')
setTimeout((=> @setError()), 2000)
else
lineNumber = @getLineNumber()
@cancel()
@openPath(filePath, lineNumber)
else
@setError('Selected path does not exist')
setTimeout((=> @setError()), 2000)
toggleFileFinder: ->
@finderMode = 'file'
@@ -109,12 +109,12 @@ describe 'FuzzyFinder', ->
expect(editor2.getPath()).toBe expectedPath
expect(editor2.isFocused).toBeTruthy()
describe "when the selected path isn't a file that exists", ->
describe "when the selected path is a directory", ->
it "leaves the the tree view open, doesn't open the path in the editor, and displays an error", ->
rootView.attachToDom()
editorPath = rootView.getActiveView().getPath()
rootView.trigger 'fuzzy-finder:toggle-file-finder'
finderView.confirmed({filePath: 'dir/this/is/not/a/file.txt'})
finderView.confirmed({filePath: project.resolve('dir')})
expect(finderView.hasParent()).toBeTruthy()
expect(rootView.getActiveView().getPath()).toBe editorPath
expect(finderView.error.text().length).toBeGreaterThan 0