]> git.r.bdr.sh - rbdr/dotfiles/blame - atom/packages/vim-mode/lib/view-models/view-model.coffee
Remove taglist vim plugin
[rbdr/dotfiles] / atom / packages / vim-mode / lib / view-models / view-model.coffee
CommitLineData
455f099b 1VimNormalModeInputElement = require './vim-normal-mode-input-element'
24c7594d
BB
2
3class 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
18class Input
19 constructor: (@characters) ->
20 isComplete: -> true
21 isRecordable: -> true
22
23module.exports = {
24 ViewModel, Input
25}