]> git.r.bdr.sh - rbdr/dotfiles/blame - atom/packages/ex-mode/lib/view-model.coffee
Remove vim-snipmate
[rbdr/dotfiles] / atom / packages / ex-mode / lib / view-model.coffee
CommitLineData
455f099b 1ExNormalModeInputElement = require './ex-normal-mode-input-element'
24c7594d
BB
2
3class ViewModel
4 constructor: (@command, opts={}) ->
5 {@editor, @exState} = @command
6
455f099b
BB
7 @view = new ExNormalModeInputElement().initialize(@, opts)
8 @editor.normalModeInputView = @view
24c7594d
BB
9 @exState.onDidFailToExecute => @view.remove()
10 @done = false
11
12 confirm: (view) ->
13 @exState.pushOperations(new Input(@view.value))
14 @done = true
15
16 cancel: (view) ->
17 unless @done
18 @exState.pushOperations(new Input(''))
19 @done = true
20
21class Input
22 constructor: (@characters) ->
23
24module.exports = {
25 ViewModel, Input
26}