]>
Commit | Line | Data |
---|---|---|
455f099b | 1 | VimNormalModeInputElement = require './vim-normal-mode-input-element' |
24c7594d BB |
2 | |
3 | class ViewModel | |
4 | constructor: (@operation, opts={}) -> | |
5 | {@editor, @vimState} = @operation | |
455f099b BB |
6 | @view = new VimNormalModeInputElement().initialize(this, atom.views.getView(@editor), opts) |
7 | @editor.normalModeInputView = @view | |
24c7594d BB |
8 | @vimState.onDidFailToCompose => @view.remove() |
9 | ||
10 | confirm: (view) -> | |
11 | @vimState.pushOperations(new Input(@view.value)) | |
12 | ||
13 | cancel: (view) -> | |
14 | if @vimState.isOperatorPending() | |
15 | @vimState.pushOperations(new Input('')) | |
455f099b | 16 | delete @editor.normalModeInputView |
24c7594d BB |
17 | |
18 | class Input | |
19 | constructor: (@characters) -> | |
20 | isComplete: -> true | |
21 | isRecordable: -> true | |
22 | ||
23 | module.exports = { | |
24 | ViewModel, Input | |
25 | } |