Mercurial > vim
comparison src/testdir/test_textformat.vim @ 20285:bce10d039e06 v8.2.0698
patch 8.2.0698: insert mode completion not fully tested
Commit: https://github.com/vim/vim/commit/f9ab52e155dc13f59b654d754041fe78e17b9074
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 5 19:57:18 2020 +0200
patch 8.2.0698: insert mode completion not fully tested
Problem: Insert mode completion not fully tested.
Solution: Add a few more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/6041)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 05 May 2020 20:00:05 +0200 |
parents | aafedd368f40 |
children | 505d97ea54da |
comparison
equal
deleted
inserted
replaced
20284:7b7c9d3abf7c | 20285:bce10d039e06 |
---|---|
973 call assert_equal(expected, getline(1, '$')) | 973 call assert_equal(expected, getline(1, '$')) |
974 | 974 |
975 bwipe! | 975 bwipe! |
976 endfunc | 976 endfunc |
977 | 977 |
978 " Test for automatically adding comment leaders in insert mode | |
979 func Test_threepiece_comment() | |
980 new | |
981 setlocal expandtab | |
982 call setline(1, ["\t/*"]) | |
983 setlocal formatoptions=croql | |
984 call cursor(1, 3) | |
985 call feedkeys("A\<cr>\<cr>/", 'tnix') | |
986 call assert_equal(["\t/*", " *", " */"], getline(1, '$')) | |
987 | |
988 " If a comment ends in a single line, then don't add it in the next line | |
989 %d | |
990 call setline(1, '/* line1 */') | |
991 call feedkeys("A\<CR>next line", 'xt') | |
992 call assert_equal(['/* line1 */', 'next line'], getline(1, '$')) | |
993 | |
994 %d | |
995 " Copy the trailing indentation from the leader comment to a new line | |
996 setlocal autoindent noexpandtab | |
997 call feedkeys("a\t/*\tone\ntwo\n/", 'xt') | |
998 call assert_equal(["\t/*\tone", "\t *\ttwo", "\t */"], getline(1, '$')) | |
999 close! | |
1000 endfunc | |
1001 | |
978 " Test for the 'f' flag in 'comments' (only the first line has the comment | 1002 " Test for the 'f' flag in 'comments' (only the first line has the comment |
979 " string) | 1003 " string) |
980 func Test_firstline_comment() | 1004 func Test_firstline_comment() |
981 new | 1005 new |
982 setlocal comments=f:- fo+=ro | 1006 setlocal comments=f:- fo+=ro |