File: test-surround.vim

package info (click to toggle)
vim-vimtex 2.16-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 8,660 kB
  • sloc: makefile: 367; python: 103
file content (42 lines) | stat: -rw-r--r-- 890 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
set nocompatible
set runtimepath^=../..
filetype plugin indent on
syntax on

set shiftwidth=2
set expandtab

nnoremap q :qall!<cr>

silent edit test-surround.tex

execute "normal 13G\<plug>(vimtex-env-surround-operator)3jnumbers\<cr>"
call assert_equal([
      \ '\begin{numbers}',
      \ '  one',
      \ '  two',
      \ '  three',
      \ '  four',
      \ '\end{numbers}'
      \], getline(13, 18))

call vimtex#env#surround(9, 10, 'verbatim')
call assert_equal([
      \ '\begin{quote}',
      \ '  \begin{verbatim}',
      \ '    This is wrongly indented.',
      \ '    Two lines.',
      \ '  \end{verbatim}',
      \ '\end{quote}'
      \], getline(8, 13))

call vimtex#env#surround(4, 6, 'test')
call assert_equal([
      \ '\begin{test}',
      \ '  Hello World!',
      \ '',
      \ '  Hello Moon!',
      \ '\end{test}',
      \], getline(4, 8))

call vimtex#test#finished()