diff options
| author | Ben Beltran <ben@nsovocal.com> | 2019-03-14 23:19:58 +0100 |
|---|---|---|
| committer | Ben Beltran <ben@nsovocal.com> | 2019-03-14 23:19:58 +0100 |
| commit | b009b50e81b6c1d0d691505b5f5c0418f559bfc0 (patch) | |
| tree | 5fae800e76219eba28634cb236565f9b4bb7a2f7 /atom/packages/vim-mode/lib/view-models/search-view-model.coffee | |
| parent | 4efcafab7f0aa454f9ebe767133654bc9f44e12c (diff) | |
Remove Atom config
Diffstat (limited to 'atom/packages/vim-mode/lib/view-models/search-view-model.coffee')
| -rw-r--r-- | atom/packages/vim-mode/lib/view-models/search-view-model.coffee | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/atom/packages/vim-mode/lib/view-models/search-view-model.coffee b/atom/packages/vim-mode/lib/view-models/search-view-model.coffee deleted file mode 100644 index 8e63fd2..0000000 --- a/atom/packages/vim-mode/lib/view-models/search-view-model.coffee +++ /dev/null @@ -1,50 +0,0 @@ -{ViewModel} = require './view-model' - -module.exports = -class SearchViewModel extends ViewModel - constructor: (@searchMotion) -> - super(@searchMotion, class: 'search') - @historyIndex = -1 - - atom.commands.add(@view.editorElement, 'core:move-up', @increaseHistorySearch) - atom.commands.add(@view.editorElement, 'core:move-down', @decreaseHistorySearch) - - restoreHistory: (index) -> - @view.editorElement.getModel().setText(@history(index)) - - history: (index) -> - @vimState.getSearchHistoryItem(index) - - increaseHistorySearch: => - if @history(@historyIndex + 1)? - @historyIndex += 1 - @restoreHistory(@historyIndex) - - decreaseHistorySearch: => - if @historyIndex <= 0 - # get us back to a clean slate - @historyIndex = -1 - @view.editorElement.getModel().setText('') - else - @historyIndex -= 1 - @restoreHistory(@historyIndex) - - confirm: (view) => - repeatChar = if @searchMotion.initiallyReversed then '?' else '/' - if @view.value is '' or @view.value is repeatChar - lastSearch = @history(0) - if lastSearch? - @view.value = lastSearch - else - @view.value = '' - atom.beep() - super(view) - @vimState.pushSearchHistory(@view.value) - - update: (reverse) -> - if reverse - @view.classList.add('reverse-search-input') - @view.classList.remove('search-input') - else - @view.classList.add('search-input') - @view.classList.remove('reverse-search-input') |