Advertisement
Guest User

Untitled

a guest
May 5th, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. Print "Verifying the contents again";
  2. .
  3. .
  4. .
  5. Print "Verifying the output to be shown"; // line 2
  6.  
  7. set completefunc=CompleteInsideSymbols
  8. function! CompleteInsideSymbols(findstart, base) abort
  9. if a:findstart
  10. let start = col('.') - 1
  11. let line = getline('.')
  12. while start > 0 && line[start - 1] !~ "["'[]"
  13. let start -= 1
  14. endwhile
  15. return start
  16. else
  17. let groups_of_words = []
  18. %s/v("zs.{-}ze"|'zs.{-}ze'|[zs.{-}ze])/=add(groups_of_words,submatch(0))/gn
  19. return filter(groups_of_words, 'v:val =~ "^" . a:base')
  20. endif
  21. endfunction
  22.  
  23. if a:findstart
  24. ...
  25. else
  26. ...
  27. endif
  28.  
  29. let start = col('.') - 1
  30. let line = getline('.')
  31.  
  32. while start > 0 && line[start - 1] !~ "["'[]"
  33. let start -= 1
  34. endwhile
  35.  
  36. return start
  37.  
  38. let groups_of_words = []
  39.  
  40. %s/v("zs.{-}ze"|'zs.{-}ze'|[zs.{-}ze])/=add(groups_of_words,submatch(0))/gn
  41.  
  42. return filter(groups_of_words, 'v:val =~ "^" . a:base')
  43.  
  44. here is " a group of quoted words " and here is " another one "
  45.  
  46. " an
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement