Mercurial > vim
comparison src/testdir/test_normal.vim @ 20261:aafedd368f40 v8.2.0686
patch 8.2.0686: formatoptions not sufficiently tested
Commit: https://github.com/vim/vim/commit/2eaeaf3c317a5145fb0bc926411561d50883019b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 3 16:04:43 2020 +0200
patch 8.2.0686: formatoptions not sufficiently tested
Problem: Formatoptions not sufficiently tested.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/6031)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 03 May 2020 16:15:03 +0200 |
parents | a4bd28e2cf1d |
children | 045442aa392b |
comparison
equal
deleted
inserted
replaced
20260:fadcfcc96545 | 20261:aafedd368f40 |
---|---|
200 endfunc | 200 endfunc |
201 set formatexpr=Format() | 201 set formatexpr=Format() |
202 norm gqG | 202 norm gqG |
203 bw! | 203 bw! |
204 set formatexpr= | 204 set formatexpr= |
205 endfunc | |
206 | |
207 " When 'formatexpr' returns non-zero, internal formatting is used. | |
208 func Test_normal_formatexpr_returns_nonzero() | |
209 new | |
210 call setline(1, ['one', 'two']) | |
211 func! Format() | |
212 return 1 | |
213 endfunc | |
214 setlocal formatexpr=Format() | |
215 normal VGgq | |
216 call assert_equal(['one two'], getline(1, '$')) | |
217 setlocal formatexpr= | |
218 delfunc Format | |
219 close! | |
205 endfunc | 220 endfunc |
206 | 221 |
207 " basic test for formatprg | 222 " basic test for formatprg |
208 func Test_normal06_formatprg() | 223 func Test_normal06_formatprg() |
209 " only test on non windows platform | 224 " only test on non windows platform |