Guest User

Untitled

a guest
Jun 27th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.88 KB | None | 0 0
  1. function! TestSetFoldable()
  2.   " Depends on visual selection
  3.   let firstline = line("'<")
  4.   let lastline = line("'>")
  5.   echo "Opening fold marker at: ".firstline
  6.   echo "Closing fold marker at: ".lastline
  7.   echo "Trying OFM .. "
  8.   call setpos('.', [ 0, firstline, 1, 0 ])
  9.   echo "e"
  10.   echo getpos('.')
  11.   exe ":normal! ".firstline."G"
  12.   echo "d"
  13.   echo getpos('.')
  14.   echo "d2"
  15.   silent! exe ":silent! normal! A # Indirect {{{"
  16.   echo "c1"
  17.   echo getpos('.')
  18.   echo "c"
  19.   exe firstline."normal! A # Direct {{{"
  20.   echo "b"
  21.   echo getpos('.')
  22.   echo "Trying CFM .. "
  23.   call setpos('.', [ 0, lastline, 1, 0 ])
  24.   echo "x"
  25.   echo getpos('.')
  26.   exe ":normal! ".lastline."G"
  27.   echo "y"
  28.   echo getpos('.')
  29.   echo "y"
  30.   exe ":normal! A # Indirect }}}"
  31.   echo "z"
  32.   echo getpos('.')
  33.   echo "z"
  34.   exe lastline."normal! A # Indirect }}}"
  35.   echo "a"
  36.   echo getpos('.')
  37. endfun
Add Comment
Please, Sign In to add comment