Mercurial > vim
view src/testdir/test45.in @ 10887:40939b171432 v8.0.0333
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
commit https://github.com/vim/vim/commit/226c53429109f24e31c17016aedfd7fbf7a9aa50
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 17 14:53:15 2017 +0100
patch 8.0.0333: illegal memory access when 'complete' ends in a backslash
Problem: Illegal memory access when 'complete' ends in a backslash.
Solution: Check for trailing backslash. (Dominique Pelle, closes https://github.com/vim/vim/issues/1478)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 17 Feb 2017 15:00:05 +0100 |
parents | b85fcd9b858d |
children | ae45d497868f |
line wrap: on
line source
Tests for folding. vim: set ft=vim : STARTTEST :so small.vim :" We also need the +syntax feature here. :if !has("syntax") e! test.ok w! test.out qa! :endif :" basic test if a fold can be created, opened, moving to the end and closed /^1 zf2j:call append("$", "manual " . getline(foldclosed("."))) zo:call append("$", foldclosed(".")) ]z:call append("$", getline(".")) zc:call append("$", getline(foldclosed("."))) :" test folding with markers. :set fdm=marker fdl=1 fdc=3 /^5 :call append("$", "marker " . foldlevel(".")) [z:call append("$", foldlevel(".")) jo{{ r{jj:call append("$", foldlevel(".")) kYpj:call append("$", foldlevel(".")) :" test folding with indent :set fdm=indent sw=2 /^2 b i jI :call append("$", "indent " . foldlevel(".")) k:call append("$", foldlevel(".")) :" test syntax folding :set fdm=syntax fdl=0 :syn region Hup start="dd" end="ii" fold contains=Fd1,Fd2,Fd3 :syn region Fd1 start="ee" end="ff" fold contained :syn region Fd2 start="gg" end="hh" fold contained :syn region Fd3 start="commentstart" end="commentend" fold contained Gzk:call append("$", "folding " . getline(".")) k:call append("$", getline(".")) jAcommentstart Acommentend:set fdl=1 3j:call append("$", getline(".")) :set fdl=0 zOj:call append("$", getline(".")) :" test expression folding :fun Flvl() let l = getline(v:lnum) if l =~ "bb$" return 2 elseif l =~ "gg$" return "s1" elseif l =~ "ii$" return ">2" elseif l =~ "kk$" return "0" endif return "=" endfun :set fdm=expr fde=Flvl() /bb$ :call append("$", "expr " . foldlevel(".")) /hh$ :call append("$", foldlevel(".")) /ii$ :call append("$", foldlevel(".")) /kk$ :call append("$", foldlevel(".")) :/^last/+1,$w! test.out :delfun Flvl :new iTest fdm=indent and :move bug END line2 Test fdm=indent START line3 line4 :set fdm=indent :1m1 2jzc:m0 :%w >> test.out :qa! ENDTEST 1 aa 2 bb 3 cc 4 dd {{{ 5 ee {{{ }}} 6 ff }}} 7 gg 8 hh 9 ii a jj b kk last