X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/70e12b926f24f5eed93d9e35db515dd1887b994d..3522dd502b500365afe4462241921216f1d3ec1d:/test/toc-autofit.vader?ds=inline diff --git a/test/toc-autofit.vader b/test/toc-autofit.vader index 005a13f..2678997 100644 --- a/test/toc-autofit.vader +++ b/test/toc-autofit.vader @@ -1,12 +1,5 @@ " Tests toc window auto-fit to longest header, but without exceeding half screen. -Before: - source ../after/ftplugin/markdown.vim - -After: - setlocal foldexpr=0 - setlocal foldmethod=manual - Given markdown; # chap 1 @@ -50,8 +43,11 @@ Execute (toc window autofit width): let line = '###### chap 12.1.1.1.1.1' AssertEqual getline('33'), line :Toc + let real_width = winwidth(0) + :lclose let expected_width = len(line) + 2*5 + 1 + 3 - 7 - AssertEqual &winwidth, expected_width + AssertEqual real_width, expected_width + set nonumber " 2 spaces * 5 additional header levels + 1 space for first header + " 3 spaces for line numbers - 7 chars ('###### ') that don't show up on the TOC