working title
This commit is contained in:
parent
ffbe36efec
commit
1a8657b3d4
13 changed files with 234 additions and 77 deletions
22
lib/view-model.coffee
Normal file
22
lib/view-model.coffee
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
ExCommandModeInputView = require './ex-command-mode-input-view'
|
||||
|
||||
class ViewModel
|
||||
constructor: (@command, opts={}) ->
|
||||
{@editor, @exState} = @command
|
||||
|
||||
@view = new ExCommandModeInputView(@, opts)
|
||||
@editor.commandModeInputView = @view
|
||||
@exState.onDidFailToExecute => @view.remove()
|
||||
|
||||
confirm: (view) ->
|
||||
@exState.pushOperations(new Input(@view.value))
|
||||
|
||||
cancel: (view) ->
|
||||
@exState.pushOperations(new Input(''))
|
||||
|
||||
class Input
|
||||
constructor: (@characters) ->
|
||||
|
||||
module.exports = {
|
||||
ViewModel, Input
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue