]> git.gir.st - VimFx.git/blob - packages/vim.coffee
Merge branch 'hints' into develop
[VimFx.git] / packages / vim.coffee
1 { getCommand, maybeCommand } = require 'commands'
2 { getWindowId, Bucket } = require 'utils'
3
4 MODE_NORMAL = 1
5
6
7 class Vim
8 constructor: (@window) ->
9 @mode = MODE_NORMAL
10 @keys = []
11
12 keypress: (keyInfo) ->
13 @keys.push keyInfo
14 if command = getCommand @keys
15 command @window
16 @keys = []
17 true
18 else if maybeCommand @keys
19 true
20 else
21 false
22
23 focus: (element) ->
24 @activeElement = element
25 console.log 'focus', @activeElement
26
27 blur: (element) ->
28 console.log 'blur', @activeElement
29 delete @activeElement if @activeElement == element
30
31 exports.Vim = Vim
Imprint / Impressum