As title, I want to make a function for foldtext like this:

function MY_TeX_BiBFoldText()
  let line = getline(v:foldstart, v:foldend)
  let matchlinea = match(line, '^\s*author.*{.*}.*') + 1
  let matchlinet = match(line, '^\s*title.*{.*}.*') + 1
  let matcha = substitute(getline(matchlinea), '^.*{\(.*\)}*.*$', '\1', 'g')
  let matcht = substitute(getline(matchlinet), '^.*{\(.*\)}*.*$', '\1', 'g')
  let matched = "title: " . matcht . "   author: " . matcha
  return v:folddashes . matched
endfunction

So the folding will show the string "matched", but I find that v:foldstart and
v:foldend have the same value in foldings, so all my foldings show the same
string, why?

-- 
Regards,
anhnmncb


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to