comparison runtime/menu.vim @ 31251:e8ac01ad4be9 v9.0.0959

patch 9.0.0959: error when using the "File Settings / Text Width" menu Commit: https://github.com/vim/vim/commit/8b336a6614463fb9ce72db24d00c5aef4f22697e Author: Bram Moolenaar <Bram@vim.org> Date: Sun Nov 27 15:51:46 2022 +0000 patch 9.0.0959: error when using the "File Settings / Text Width" menu Problem: Error when using the "File Settings / Text Width" menu. Solution: Use str2nr(). (closes https://github.com/vim/vim/issues/11624)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Nov 2022 17:00:04 +0100
parents 58592b6af4e2
children 0257c9dedf56
comparison
equal deleted inserted replaced
31250:65c361477a7d 31251:e8ac01ad4be9
339 var n = inputdialog(g:menutrans_textwidth_dialog, &tw .. '') 339 var n = inputdialog(g:menutrans_textwidth_dialog, &tw .. '')
340 if n != "" 340 if n != ""
341 # Remove leading zeros to avoid it being used as an octal number. 341 # Remove leading zeros to avoid it being used as an octal number.
342 # But keep a zero by itself. 342 # But keep a zero by itself.
343 var tw = substitute(n, "^0*", "", "") 343 var tw = substitute(n, "^0*", "", "")
344 &tw = tw == '' ? 0 : tw 344 &tw = tw == '' ? 0 : str2nr(tw)
345 endif 345 endif
346 enddef 346 enddef
347 347
348 def s:FileFormat() 348 def s:FileFormat()
349 if !exists("g:menutrans_fileformat_dialog") 349 if !exists("g:menutrans_fileformat_dialog")