patch 9.1.0309: crash when 'textwidth' > MAX_INT
Problem: crash when 'textwidth' > MAX_INT (after vv9.1.0055)
(Zoltan Balogh)
Solution: limit textwidth to MAX_INT
fixes: #14482
closes: #14489
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_textformat.vim b/src/testdir/test_textformat.vim
index c5f5975..a9cffd0 100644
--- a/src/testdir/test_textformat.vim
+++ b/src/testdir/test_textformat.vim
@@ -1303,4 +1303,13 @@
set encoding=utf8
endfunc
+" This was crashing Vim
+func Test_textwdith_overflow()
+ new
+ setl tw=999999999
+ normal 10ig
+ call feedkeys('a ab cd ef', 'xt')
+ bw!
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab