From fc50d2ce195f03ad65a68b2e1eb4d61de7db5f0a Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Fri, 6 Feb 2015 22:08:38 +0800 Subject: [PATCH] beep when search history is exhausted --- lib/view-models/search-view-model.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/view-models/search-view-model.coffee b/lib/view-models/search-view-model.coffee index 9f30066e..4941fce2 100644 --- a/lib/view-models/search-view-model.coffee +++ b/lib/view-models/search-view-model.coffee @@ -19,9 +19,13 @@ class SearchViewModel extends ViewModel if @history(@historyIndex + 1)? @historyIndex += 1 @restoreHistory(@historyIndex) + else + atom.beep() decreaseHistorySearch: => - if @historyIndex <= 0 + if @historyIndex < 0 + atom.beep() + else if @historyIndex == 0 # get us back to a clean slate @historyIndex = -1 @view.editor.setText('')