1 utils = require 'utils'
2 hints = require 'hints'
5 enter: (vim, storage, [ markers, cb ]) ->
6 storage.markers = markers
9 handleKeyDown: (vim, storage, event, keyStr) ->
10 if utils.getHintChars().search(utils.regexpEscape(keyStr)) > -1
11 @hintCharHandler(vim, storage, keyStr)
14 onEnterNormalMode: (vim, storage) ->
15 hints.removeHints(vim.window.document)
16 storage.markers = storage.cb = undefined
18 # Processes the char, updates and hides/shows markers
19 hintCharHandler: (vim, storage, keyStr) ->
21 # Get char and escape it to avoid problems with String.search
22 key = utils.regexpEscape(keyStr)
24 { markers, cb } = storage
26 # First do a pre match - count how many markers will match with the new character entered
27 if markers.reduce(((v, marker) -> v or marker.willMatch(key)), false)
29 marker.matchHintChar(key)
32 # Add element features to the bloom filter