blob: af96e77ce099063960a97d2154883ea73825e7f2 (
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
26
|
ExCommandModeInputElement = require './ex-command-mode-input-element'
class ViewModel
constructor: (@command, opts={}) ->
{@editor, @exState} = @command
@view = new ExCommandModeInputElement().initialize(@, opts)
@editor.commandModeInputView = @view
@exState.onDidFailToExecute => @view.remove()
@done = false
confirm: (view) ->
@exState.pushOperations(new Input(@view.value))
@done = true
cancel: (view) ->
unless @done
@exState.pushOperations(new Input(''))
@done = true
class Input
constructor: (@characters) ->
module.exports = {
ViewModel, Input
}
|