mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Clear mini editor base select list cancelled()
Clearing the mini editor when closing is something all sub-classes were already doing so it makes sense to pull it up to the base class as the default cancelled() implementation that can still be overridden if needed.
This commit is contained in:
@@ -35,9 +35,6 @@ class GrammarView extends SelectList
|
||||
grammars.unshift(@autoDetect)
|
||||
@setArray(grammars)
|
||||
|
||||
cancelled: ->
|
||||
@miniEditor.setText('')
|
||||
|
||||
confirmed: (grammar) ->
|
||||
@cancel()
|
||||
if grammar is @autoDetect
|
||||
|
||||
@@ -130,6 +130,9 @@ class SelectList extends View
|
||||
restoreFocus: ->
|
||||
@previouslyFocusedElement?.focus()
|
||||
|
||||
cancelled: ->
|
||||
@miniEditor.setText('')
|
||||
|
||||
cancel: ->
|
||||
@list.empty()
|
||||
@cancelling = true
|
||||
|
||||
@@ -74,10 +74,10 @@ class AutocompleteView extends SelectList
|
||||
@editor.setCursorBufferPosition([position.row, position.column + match.suffix.length])
|
||||
|
||||
cancelled: ->
|
||||
super
|
||||
|
||||
@editor.abort()
|
||||
@editor.setSelectedBufferRange(@originalSelectionBufferRange)
|
||||
|
||||
@miniEditor.setText('')
|
||||
@editor.rootView()?.focus() if @miniEditor.isFocused
|
||||
|
||||
attach: ->
|
||||
|
||||
@@ -35,7 +35,6 @@ class CommandPaletteView extends SelectList
|
||||
|
||||
@setArray(events)
|
||||
@appendTo(@rootView)
|
||||
@miniEditor.setText('')
|
||||
@miniEditor.focus()
|
||||
|
||||
itemForElement: ({eventName, eventDescription}) ->
|
||||
@@ -52,5 +51,3 @@ class CommandPaletteView extends SelectList
|
||||
confirmed: ({eventName}) ->
|
||||
@cancel()
|
||||
@previouslyFocusedElement.trigger(eventName)
|
||||
|
||||
cancelled: ->
|
||||
|
||||
@@ -72,9 +72,6 @@ class FuzzyFinderView extends SelectList
|
||||
@setError('Selected path does not exist')
|
||||
setTimeout((=> @setError()), 2000)
|
||||
|
||||
cancelled: ->
|
||||
@miniEditor.setText('')
|
||||
|
||||
toggleFileFinder: ->
|
||||
if @hasParent()
|
||||
@cancel()
|
||||
|
||||
@@ -88,9 +88,6 @@ class SymbolsView extends SelectList
|
||||
editor.setCursorBufferPosition(position)
|
||||
editor.moveCursorToFirstCharacterOfLine()
|
||||
|
||||
cancelled: ->
|
||||
@miniEditor.setText('')
|
||||
|
||||
attach: ->
|
||||
super
|
||||
|
||||
|
||||
Reference in New Issue
Block a user