Skip to content
This repository was archived by the owner on Apr 6, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions lib/motions/search-motion.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ class Search extends SearchBase
constructor: (@editor, @vimState) ->
super(@editor, @vimState)
@viewModel = new SearchViewModel(this)
@updateViewModel()

reversed: =>
@initiallyReversed = @reverse = true
@updateCurrentSearch()
@updateViewModel()
this

updateViewModel: ->
@viewModel.update(@initiallyReversed)

class SearchCurrentWord extends SearchBase
@keywordRegex: null
Expand Down
8 changes: 8 additions & 0 deletions lib/view-models/search-view-model.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,11 @@ class SearchViewModel extends ViewModel
atom.beep()
super(view)
@vimState.pushSearchHistory(@view.value)

update: (reverse) ->
if reverse
@view.editorContainer.classList.add('reverse-search-input')
@view.editorContainer.classList.remove('search-input')
else
@view.editorContainer.classList.add('search-input')
@view.editorContainer.classList.remove('reverse-search-input')
8 changes: 8 additions & 0 deletions styles/vim-mode.less
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,11 @@ atom-text-editor.vim-mode.operator-pending-mode.is-focused
}
}
}

.search-input atom-text-editor[mini]::before {
content: '/';
}

.reverse-search-input atom-text-editor[mini]::before {
content: '?';
}