Merge branch 'dev'

This commit is contained in:
Kevin Sawicki
2013-02-28 15:20:19 -08:00
5 changed files with 47 additions and 9 deletions

View File

@@ -321,7 +321,18 @@ static void parseTagLine (tagFile *file, tagEntry *const entry)
do
{
p = strchr (p + 1, delimiter);
} while (p != NULL && *(p - 1) == '\\');
if (p == NULL)
break;
if (*(p - 1) != '\\')
break;
// Make sure preceeding backslas isn't an escaped backslash by
// advancing backwards and counting the number of backslashes
int slashCount = 1;
while (*(p - slashCount - 1) == '\\')
slashCount++;
if (slashCount % 2 == 0)
break;
} while (1);
if (p == NULL)
{
/* invalid pattern */

View File

@@ -88,9 +88,6 @@ class CommandPanelView extends View
else
@miniEditor.focus()
toggleLoading: ->
@loadingMessage.toggle()
onExpandAll: (event) =>
@previewList.expandAllPaths()
@previewList.focus()
@@ -119,12 +116,12 @@ class CommandPanelView extends View
@miniEditor.getText()
execute: (command=@escapedCommand())->
@toggleLoading()
@loadingMessage.show()
@errorMessages.empty()
try
@commandInterpreter.eval(command, rootView.getActiveEditSession()).done ({operationsToPreview, errorMessages}) =>
@toggleLoading()
@loadingMessage.hide()
@history.push(command)
@historyIndex = @history.length

View File

@@ -1 +1 @@
'main': 'lib/spell-check.coffee'
'main': 'lib/spell-check'

View File

@@ -77,8 +77,12 @@ class SymbolsView extends SelectList
setTimeout (=> @cancel()), 2000
confirmed : (tag) ->
@cancel()
@openTag(tag)
if tag.file and not fs.isFile(project.resolve(tag.file))
@setError('Selected file does not exist')
setTimeout((=> @setError()), 2000)
else
@cancel()
@openTag(tag)
openTag: (tag) ->
position = tag.position

View File

@@ -201,3 +201,29 @@ describe "SymbolsView", ->
expect(symbolsView.list.children('li:last').find('.function-details')).toHaveText 'tagged.js'
expect(symbolsView).not.toHaveClass "error"
expect(symbolsView.error).not.toBeVisible()
describe "when selecting a tag", ->
describe "when the file doesn't exist", ->
renamedPath = null
beforeEach ->
renamedPath = project.resolve("tagged-renamed.js")
fs.remove(renamedPath) if fs.exists(renamedPath)
fs.move(project.resolve("tagged.js"), renamedPath)
afterEach ->
fs.move(renamedPath, project.resolve("tagged.js"))
it "doesn't open the editor", ->
rootView.trigger "symbols-view:toggle-project-symbols"
symbolsView = rootView.find('.symbols-view').view()
waitsFor ->
setArraySpy.callCount > 0
runs ->
spyOn(rootView, 'open').andCallThrough()
symbolsView.list.children('li:first').mousedown().mouseup()
expect(rootView.open).not.toHaveBeenCalled()
expect(symbolsView.error.text().length).toBeGreaterThan 0
expect(symbolsView).toHaveClass "error"