diff options
Diffstat (limited to 'runtime/menu.vim')
-rw-r--r-- | runtime/menu.vim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/menu.vim b/runtime/menu.vim index 656212e41..f4ff9dce8 100644 --- a/runtime/menu.vim +++ b/runtime/menu.vim @@ -2,7 +2,7 @@ " You can also use this as a start for your own set of menus. " " Maintainer: Bram Moolenaar <Bram@vim.org> -" Last Change: 2012 Dec 06 +" Last Change: 2013 May 17 " Note that ":an" (short for ":anoremenu") is often used to make a menu work " in all modes and avoid side effects from mappings defined by the user. @@ -308,8 +308,10 @@ fun! s:TextWidth() endif let n = inputdialog(g:menutrans_textwidth_dialog, &tw) if n != "" - " remove leading zeros to avoid it being used as an octal number - let &tw = substitute(n, "^0*", "", "") + " Remove leading zeros to avoid it being used as an octal number. + " But keep a zero by itself. + let tw = substitute(n, "^0*", "", "") + let &tw = tw == '' ? 0 : tw endif endfun |