From c43b2658efcfa6786e573b743d308476ca844496 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Sun, 24 May 2015 15:56:53 +0200 Subject: [PATCH] stop spurious cancels --- lib/view-model.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/view-model.coffee b/lib/view-model.coffee index 5e761b1..af96e77 100644 --- a/lib/view-model.coffee +++ b/lib/view-model.coffee @@ -7,12 +7,16 @@ class ViewModel @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) -> - @exState.pushOperations(new Input('')) + unless @done + @exState.pushOperations(new Input('')) + @done = true class Input constructor: (@characters) ->