]> git.r.bdr.sh - rbdr/dotfiles/blame_incremental - atom/packages/ex-mode/lib/view-model.coffee
Fixes submodule names for paths
[rbdr/dotfiles] / atom / packages / ex-mode / lib / view-model.coffee
... / ...
CommitLineData
1ExNormalModeInputElement = require './ex-normal-mode-input-element'
2
3class ViewModel
4 constructor: (@command, opts={}) ->
5 {@editor, @exState} = @command
6
7 @view = new ExNormalModeInputElement().initialize(@, opts)
8 @editor.normalModeInputView = @view
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}