diff --git a/NEWS b/NEWS index 14fb7a08..1b701e29 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@
 2007-xx-xx:
 	* version 0.6
+	* added a visual bell and replaced 'beep' with 'visualbell'
 	* added vimperator logo (can be seen in the addons manager)
 	* added 'hlsearch','incsearch', 'ignorecase' and 'smartcase' options
 
diff --git a/chrome/content/vimperator/default.css b/chrome/content/vimperator/default.css
index d3968b10..b3144c01 100644
--- a/chrome/content/vimperator/default.css
+++ b/chrome/content/vimperator/default.css
@@ -165,6 +165,11 @@ fieldset.paypal {
     overflow: hidden;
 }
 
+#vimperator-visualbell {
+    background-color: blue;
+    opacity: 0.5;
+}
+
 .status_insecure, .status_insecure * {
     background-color: transparent;
 }
diff --git a/chrome/content/vimperator/events.js b/chrome/content/vimperator/events.js
index 7b095270..ac15ae5b 100644
--- a/chrome/content/vimperator/events.js
+++ b/chrome/content/vimperator/events.js
@@ -80,7 +80,7 @@ function Events() //{{{
 
     function enterPopupMode(event)
     {
-        if (event.originalTarget.localName == "tooltip")
+        if (event.originalTarget.localName == "tooltip" || event.originalTarget.id == "vimperator-visualbell")
             return;
 
         vimperator.addMode(null, vimperator.modes.MENU);
diff --git a/chrome/content/vimperator/options.js b/chrome/content/vimperator/options.js
index f52b370e..4894440d 100644
--- a/chrome/content/vimperator/options.js
+++ b/chrome/content/vimperator/options.js
@@ -343,12 +343,6 @@ function Options() //{{{
             default_value: "homepage,quickmark,tabopen,paste"
         }
     ));
-    addOption(new Option(["beep"], "boolean",
-        {
-            short_help: "Emit a pc speaker beep on certain errors",
-            default_value: true
-        }
-    ));
     addOption(new Option(["complete", "cpt"], "charlist",
         {
             short_help: "Items which are completed at the :[tab]open prompt",
@@ -547,6 +541,12 @@ function Options() //{{{
             validator: function (value) { if (value >= 0 && value <= 9) return true; else return false; }
         }
     ));
+    addOption(new Option(["visualbell", "vb"], "boolean",
+        {
+            short_help: "Use visual bell instead of beeping on errors",
+            default_value: false
+        }
+    ));
     addOption(new Option(["wildmode", "wim"], "stringlist",
         {
             short_help: "Define how command line completion works",
diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js
index d1455863..f98a4841 100644
--- a/chrome/content/vimperator/vimperator.js
+++ b/chrome/content/vimperator/vimperator.js
@@ -280,8 +280,22 @@ const vimperator = (function() //{{{
 
         beep: function()
         {
-            if (vimperator.options["beep"])
+            if (!vimperator.options["visualbell"])
+            {
                 sound_service.beep();
+                return;
+            }
+
+            // flash the visual bell
+            var popup = document.getElementById("vimperator-visualbell");
+            var win = document.getElementById("main-window");
+            var box = document.getBoxObjectFor(win);
+
+            popup.height = box.height;
+            popup.width = box.width;
+            popup.showPopup(win, box.screenX, box.screenY, "popup");
+
+            setTimeout(function() { popup.hidePopup(); }, 375);
         },
 
         copyToClipboard: function(str)
diff --git a/chrome/content/vimperator/vimperator.xul b/chrome/content/vimperator/vimperator.xul
index 20463c1e..069f794e 100644
--- a/chrome/content/vimperator/vimperator.xul
+++ b/chrome/content/vimperator/vimperator.xul
@@ -116,6 +116,11 @@ the terms of any one of the MPL, the GPL or the LGPL.
            
            
         
+
+        
+            
+        
+
     
 
 
diff --git a/vimperator.vim b/vimperator.vim
index 68ae6103..8a6a92c4 100644
--- a/vimperator.vim
+++ b/vimperator.vim
@@ -29,11 +29,11 @@ syn keyword vimperatorCommand addo[ns] ba[ck] bd[elete] bw[ipeout] bun[load] tab
 syn match vimperatorCommandWrapper "\<\h\w*\>" contains=vimperatorCommand
 
 syn region vimperatorSet matchgroup=vimperatorCommand start="\" end="$" keepend oneline contains=vimperatorOption
-syn keyword vimperatorOption activate beep nobeep beep complete cpt defsearch ds extendedhinttags eht focusedhintstyle fhs
-	\ fullscreen fs nofullscreen nofs guioptions go hintchars hc hintstyle hs hinttags incsearch is noincsearch nois
-	\ ignorecase ic noignorecase noic maxhints mh preload nopreload previewheight pvh showmode smd noshowmode nosmd
-	\ showstatuslinks ssli showtabline stal smartcase scs nosmartcase noscs titlestring usermode um nousermode noum verbose
-	\ vbs wildmode wim wildoptions wop
+syn keyword vimperatorOption activate act complete cpt defsearch ds extendedhinttags eht focusedhintstyle fhs fullscreen fs
+	\ nofullscreen nofs guioptions go hintchars hc hintstyle hs hinttags incsearch is noincsearch nois ignorecase ic
+	\ noignorecase noic maxhints mh preload nopreload previewheight pvh showmode smd noshowmode nosmd showstatuslinks ssli
+	\ showtabline stal smartcase scs nosmartcase noscs titlestring usermode um nousermode noum verbose vbs visualbell vb
+	\ wildmode wim wildoptions wop
 	\ contained
 
 syn region vimperatorJavascript start="\%(^\s*\%(javascript\|js\)\s\+\)\@<=" end="$" contains=@javascriptTop keepend oneline