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