mirror of
https://github.com/preservim/vim-pencil.git
synced 2025-11-14 12:53:46 -05:00
defensive coercion of tw str to number
This commit is contained in:
@@ -229,8 +229,9 @@ fun! s:doOne(item) abort
|
|||||||
let l:matches = matchlist(a:item, '^\([a-z]\+\)=\([a-zA-Z0-9_\-.]\+\)$')
|
let l:matches = matchlist(a:item, '^\([a-z]\+\)=\([a-zA-Z0-9_\-.]\+\)$')
|
||||||
if len(l:matches) > 1
|
if len(l:matches) > 1
|
||||||
if l:matches[1] =~ 'textwidth\|tw'
|
if l:matches[1] =~ 'textwidth\|tw'
|
||||||
if l:matches[2] > b:max_textwidth
|
let l:tw = str2nr(l:matches[2])
|
||||||
let b:max_textwidth = l:matches[2]
|
if l:tw > b:max_textwidth
|
||||||
|
let b:max_textwidth = l:tw
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user