I think I found a bug. This script doesn't work when I don't have the line `set guifont = Monospace\ 11` in my .vimrc file.