From 73f8c2e7bd3d0c8c88e701f885ab5698f7264dda Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 10 Sep 2016 04:47:46 +0200 Subject: [PATCH] Don't hide changed notification when exiting Hints mode For example, if the `f` command is used to click the "Export all" button in VimFx's settings page in the Add-ons Manager, the export notification was only visible until `hints.matched_timeout` had passed. --- extension/lib/hints-mode.coffee | 4 +++- extension/lib/vim.coffee | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/extension/lib/hints-mode.coffee b/extension/lib/hints-mode.coffee index d0c64bc..16d479a 100644 --- a/extension/lib/hints-mode.coffee +++ b/extension/lib/hints-mode.coffee @@ -57,7 +57,9 @@ cleanup = (vim, storage) -> {markerContainer, matchText} = storage markerContainer?.remove() vim._run('clear_selection') if matchText and vim.mode != 'caret' - vim.hideNotification() if vim.options.notify_entered_keys + if vim.options.notify_entered_keys and + markerContainer.enteredText == vim._state.lastNotification + vim.hideNotification() storage.clearInterval?() for key of storage storage[key] = null diff --git a/extension/lib/vim.coffee b/extension/lib/vim.coffee index 65e86ea..dbadc88 100644 --- a/extension/lib/vim.coffee +++ b/extension/lib/vim.coffee @@ -99,6 +99,7 @@ class Vim @_state = { frameCanReceiveEvents: false scrollableElements: new ScrollableElements(@window) + lastNotification: null } _isBlacklisted: (url) -> @options.blacklist.some((regex) -> regex.test(url)) @@ -169,6 +170,7 @@ class Vim messageManager.send(name, data, callback, @_messageManagerOptions(options)) notify: (message) -> + @_state.lastNotification = message @_parent.emit('notification', {vim: this, message}) if @options.notifications_enabled @_statusPanel.setAttribute('label', message) -- 2.39.3