diff options
author | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-20 22:24:03 -0500 |
---|---|---|
committer | jluehrs2 <jluehrs2@uiuc.edu> | 2008-04-20 22:24:03 -0500 |
commit | 92afbfb3ae8e1a8824417289c17e47939083ccee (patch) | |
tree | 1518b595f8e4628dfa8d8ef6a3a86741f5ff4e79 | |
parent | 821290599a15452d2604fc5b0a29b6b0aa1b0c07 (diff) | |
download | vim-foldtext-92afbfb3ae8e1a8824417289c17e47939083ccee.tar.gz vim-foldtext-92afbfb3ae8e1a8824417289c17e47939083ccee.zip |
use the commentstring option to filter out most comment strings from our display
-rw-r--r-- | vimrc | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -296,6 +296,15 @@ function Base_foldtext(...) let foldmarkers = split(&foldmarker, ',') let line = substitute(line, '\V\s\?' . foldmarkers[0] . '\s\?', ' ', '') + " remove comments that we know about + let comment = split(&commentstring, '%s') + if comment[0] != '' + let line = substitute(line, '\V' . comment[0], ' ', '') + endif + if comment[1] != '' + let line = substitute(line, '\V' . comment[1], ' ', '') + endif + " remove any remaining leading or trailing whitespace let line = substitute(line, '^\s*\(.\{-}\)\s*$', '\1', '') |