From 49dfcc3652075babcc9fff4da62a246e9bd67789 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Tue, 10 Nov 2015 07:31:05 +0100 Subject: [PATCH] Add an advanced option to disable notifications Fixes #576. --- documentation/options.md | 6 ++++++ extension/lib/defaults.coffee | 1 + extension/lib/vim.coffee | 1 + 3 files changed, 8 insertions(+) diff --git a/documentation/options.md b/documentation/options.md index 8785e55..06e6ccb 100644 --- a/documentation/options.md +++ b/documentation/options.md @@ -145,6 +145,12 @@ see them all in [defaults.coffee].) [public API]: api.md [defaults.coffee]: ../extension/lib/defaults.coffee +### `notifications_enabled` + +Some commands may show a notification, such as the `n` and `N` commands which +tell when they wrap around the page, or the phrase you searched for could not be +found. Set this option to `false` to disable such notifications. + ### `prevent_target_blank` You might have noticed that some links open in new tabs when you click them. diff --git a/extension/lib/defaults.coffee b/extension/lib/defaults.coffee index dc3539c..8d8ad68 100644 --- a/extension/lib/defaults.coffee +++ b/extension/lib/defaults.coffee @@ -122,6 +122,7 @@ options = 'timeout': 2000 advanced_options = + 'notifications_enabled': true 'prevent_target_blank': true 'prevent_autofocus_modes': 'normal' 'hints_timeout': 200 diff --git a/extension/lib/vim.coffee b/extension/lib/vim.coffee index 6a10056..bae426f 100644 --- a/extension/lib/vim.coffee +++ b/extension/lib/vim.coffee @@ -136,6 +136,7 @@ class Vim messageManager.send(name, data, @_messageManager, callback) notify: (title, options = {}) -> + return unless @options.notifications_enabled new @window.Notification(title, Object.assign({ icon: 'chrome://vimfx/skin/icon128.png' tag: 'VimFx-notification' -- 2.39.3