From f091e7fe480ef6ce5dc383c18f217d73b36c758f Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Thu, 14 Jul 2016 14:31:04 +0200 Subject: [PATCH] Fix toggling of the help dialog by the button --- extension/lib/button.coffee | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extension/lib/button.coffee b/extension/lib/button.coffee index d9addb3..08c2453 100644 --- a/extension/lib/button.coffee +++ b/extension/lib/button.coffee @@ -38,12 +38,14 @@ injectButton = (vimfx) -> window = button.ownerGlobal return unless vim = vimfx.getCurrentVim(window) + helpVisible = help.getHelp(window) + # If we somehow have gotten stuck with `vim.focusType == 'editable'`, - # allow the buttton to reset to 'none'. + # allow the buttton to reset to 'none'. (This also hides the help dialog.) vimfx.modes.normal.commands.esc.run({vim}) - if vim.mode == 'normal' - help.toggleHelp(window, vimfx) + if vim.mode == 'normal' and not helpVisible + help.injectHelp(window, vimfx) else vim.enterMode('normal') }) -- 2.39.3