]> git.r.bdr.sh - rbdr/dotfiles/blame_incremental - atom/packages/vim-mode/lib/view-models/view-model.coffee
Adds editorconfig
[rbdr/dotfiles] / atom / packages / vim-mode / lib / view-models / view-model.coffee
... / ...
CommitLineData
1VimNormalModeInputElement = require './vim-normal-mode-input-element'
2
3class ViewModel
4 constructor: (@operation, opts={}) ->
5 {@editor, @vimState} = @operation
6 @view = new VimNormalModeInputElement().initialize(this, atom.views.getView(@editor), opts)
7 @editor.normalModeInputView = @view
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(''))
16 delete @editor.normalModeInputView
17
18class Input
19 constructor: (@characters) ->
20 isComplete: -> true
21 isRecordable: -> true
22
23module.exports = {
24 ViewModel, Input
25}