Hi  ,

I wrote a function , it will read lines from a file, each line is a
directory, after got the line, I will add filetype filter at the end of it.
If user put some spaces at end of the line, it will cause error.


Is there any way to remove the trailing spaces?


I know I can write a function to do this, but is there a function I can call
?


Following is my funtion:


function s:Searchwordglzx(filetype)
  let searchstring = expand("<cword>")

  let searchdir = ''
  for line in readfile("sdir.txt",'',6)
     ""let searchdir .= fnameescape(line).'*.[csh] '
     let searchdir .= fnameescape(line).a:filetype.' '
  endfor

  if searchstring != ""
    execute "vimgrep " searchstring searchdir
  endif

endfunction



Sincerely,


 Michael

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to