X-Git-Url: https://git.r.bdr.sh/rbdr/dotfiles/blobdiff_plain/24c7594d62d8d7fbbcdb64b11ce4adc5d8e6991a..3d3e182ac0c5c2f91a90771b79b5c221102f9635:/atom/packages/vim-mode/lib/motions/search-motion.coffee?ds=inline diff --git a/atom/packages/vim-mode/lib/motions/search-motion.coffee b/atom/packages/vim-mode/lib/motions/search-motion.coffee index 11761ad..fa65e19 100644 --- a/atom/packages/vim-mode/lib/motions/search-motion.coffee +++ b/atom/packages/vim-mode/lib/motions/search-motion.coffee @@ -6,8 +6,6 @@ SearchViewModel = require '../view-models/search-view-model' settings = require '../settings' class SearchBase extends MotionWithInput - operatesInclusively: false - constructor: (@editor, @vimState, options = {}) -> super(@editor, @vimState) @reverse = @initiallyReversed = false @@ -27,6 +25,8 @@ class SearchBase extends MotionWithInput atom.beep() scan: (cursor) -> + return [] if @input.characters is "" + currentPosition = cursor.getBufferPosition() [rangesBefore, rangesAfter] = [[], []] @@ -75,6 +75,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