mirror of
https://github.com/atom/atom.git
synced 2026-02-16 01:25:13 -05:00
Restore old UI
This commit is contained in:
@@ -176,8 +176,7 @@ class Project
|
||||
|
||||
for [column, length] in matchPositions
|
||||
range = new Range([row, column], [row, column + length])
|
||||
match = lineText.substr(column , length)
|
||||
iterator({path, range, match, lineText})
|
||||
iterator({path, range, lineText})
|
||||
|
||||
deferred = $.Deferred()
|
||||
exit = (code) ->
|
||||
|
||||
@@ -12,8 +12,8 @@ module.exports =
|
||||
class CommandPanelView extends View
|
||||
@content: ->
|
||||
@div class: 'command-panel tool-panel', =>
|
||||
@div class: 'loading is-loading', outlet: 'loadingMessage', 'Searching...'
|
||||
@div class: 'header', outlet: 'previewHeader', =>
|
||||
@span outlet: 'searchLoadingMessage', class: 'loading', 'Searching...'
|
||||
@ul outlet: 'expandCollapse', class: 'expand-collapse', =>
|
||||
@li class: 'collapse', 'Collapse All'
|
||||
@span outlet: 'previewCount', class: 'preview-count'
|
||||
@@ -53,8 +53,7 @@ class CommandPanelView extends View
|
||||
@previewList.hide()
|
||||
@previewHeader.hide()
|
||||
@errorMessages.hide()
|
||||
@searchLoadingMessage.hide()
|
||||
@expandCollapse.hide()
|
||||
@loadingMessage.hide()
|
||||
@prompt.iconSize(@miniEditor.getFontSize())
|
||||
|
||||
@history = state.history ? []
|
||||
@@ -126,14 +125,13 @@ class CommandPanelView extends View
|
||||
@miniEditor.getText()
|
||||
|
||||
execute: (command=@escapedCommand()) ->
|
||||
@previewHeader.show()
|
||||
@searchLoadingMessage.show()
|
||||
@loadingMessage.show()
|
||||
@previewList.hide()
|
||||
@errorMessages.empty()
|
||||
|
||||
try
|
||||
@commandInterpreter.eval(command, rootView.getActivePaneItem()).done ({operationsToPreview, errorMessages}) =>
|
||||
@searchLoadingMessage.hide()
|
||||
@expandCollapse.show()
|
||||
@loadingMessage.hide()
|
||||
@history.push(command)
|
||||
@historyIndex = @history.length
|
||||
|
||||
@@ -143,13 +141,14 @@ class CommandPanelView extends View
|
||||
@errorMessages.append $$ ->
|
||||
@li errorMessage for errorMessage in errorMessages
|
||||
else if operationsToPreview?.length
|
||||
@previewHeader.show()
|
||||
@previewList.populate(operationsToPreview)
|
||||
@previewList.focus()
|
||||
@previewCount.text("#{_.pluralize(operationsToPreview.length, 'match', 'matches')} in #{_.pluralize(@previewList.getPathCount(), 'file')}").show()
|
||||
else
|
||||
@detach()
|
||||
catch error
|
||||
@searchLoadingMessage.hide()
|
||||
@loadingMessage.hide()
|
||||
if error.name is "SyntaxError"
|
||||
@flashError()
|
||||
return
|
||||
|
||||
@@ -13,13 +13,13 @@ class SelectAllMatchesInProject extends Command
|
||||
compile: (project, buffer, range) ->
|
||||
deferred = $.Deferred()
|
||||
operations = []
|
||||
promise = project.scan @regex, ({path, range, match, lineText}) ->
|
||||
promise = project.scan @regex, ({path, range, lineText}) ->
|
||||
operations.push(new Operation(
|
||||
project: project
|
||||
path: path
|
||||
bufferRange: range
|
||||
lineText: lineText
|
||||
)
|
||||
))
|
||||
|
||||
promise.done -> deferred.resolve(operations)
|
||||
deferred.promise()
|
||||
deferred.promise()
|
||||
@@ -24,9 +24,9 @@ class Operation
|
||||
|
||||
preview: ->
|
||||
range = @bufferRange
|
||||
prefix = @lineText[0...range.start.column]
|
||||
match = @lineText[range.start.column...range.end.column]
|
||||
suffix = @lineText[range.end.column..]
|
||||
prefix = @lineText[0...range.start.column + 1]
|
||||
match = @lineText[range.start.column + 1...range.end.column + 1]
|
||||
suffix = @lineText[range.end.column + 1..]
|
||||
|
||||
{prefix, suffix, match, range}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user