I've now had two reports of users that Vim rings a bell or flashes the screen with every keystroke when editing a note in insert mode. The first report was in July and judging by the e-mail headers the user was running Vim on Windows. The second report I got a few days ago from @bioe007 who's running Linux and Vim 7.3.266 (I'm running the same version of Vim).
So far I have failed to reproduce the problem. When I got the first report I was actually worried that the notes plug-in was beeping at every user and I had never noticed because I've disabled my system speaker :-), however even when I enable Vim's errorbells and visualbell options I cannot get Vim to flash the screen using my notes plug-in (I did confirm that the screen flashes when I pressed Escape in normal mode).
I have tried running the notes plug-in in isolation (outside of my Vim profile) hoping the problem was being obscured by my vimrc or another one of my plug-ins, however this also doesn't help me reproduce the problem. I used the following shell commands to execute the notes plug-in isolation (and confirmed that no scripts from my Vim profile were being loaded by using the :scriptnames command):
echo set nocompatible > $PROFILE/.vimrc
ln -s $PWD $PROFILE/.vim
I now think the problem only manifests using a certain combination of settings and/or plug-ins, so my next step will be to try to find out what those settings and/or plug-ins are.
Ok, we lost some time but here is the explanation, and I think there is a very solid workaround.
First, this should only affect gvim, terminal vim does not have this issue.
The issue is created by setting:
set vb t_vb=
Usually done in vimrc. Which is recommended in vim's help for having no 'bell' (see :he visualbell)
However the help also states that if using gvim then it must be re-applied in gvimrc.
so, the easiest workaround:
echo 'set vb t_vb=' >> ~/.gvimrc
that should fix it.
@bioe007: Thanks a lot for following up on this issue! I will document the problem and solution in the README to make sure others can easily find it.
I recently had this issue in MacVim in a terminal (not gvim). I'm normally a Linux user and I've never encountered this issue before. I'll experiment with the workarounds and let you know if I find anything.
I think I've found the root cause - commenting out this line in ftplugin/notes.vim stops the constant bells for me:
Why this happens, I do not know. Is disabling matching pair highlighting critical for this plugin, or can we just delete that line (and the corresponding undo stuff)?
Release 0.12.9 including &matchpairs bug fix (issues #10 and #11)
Hi @bioe007 and @peplin,
Thanks to both of you for your input regarding the (visual) bell bug in vim-notes. I sincerely hope the suggestion by Peplin resolves this issue. I'm fine with the change itself although I suspect that if this change resolves the issue, we've actually uncovered a bug in Vim regarding the handling of the matchpairs option. If the issue is not resolved, feel free to get back to me of course!
now works for me (without the gvimrc fix)
Thanks for confirming that the fix works! I guess the culprit was indeed the matchpairs option. I'm closing this issue now. I'll also add a note to the to-do list reminding me to check whether this is a bug in Vim or simply user error (me being the user in this context, since I'm writing the Vim scripts).
TODO: Find out why matchpairs manipulation causes constant harassment…
* where harassment is defined as Vim ringing a bell or flashing the screen
for every key press in insert mode while editing notes (see issue #10)